From: Richard Kimberly Heck Date: Sat, 28 Mar 2020 19:23:13 +0000 (-0400) Subject: Fix crash after 24926b2e239. X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=0e69ecdaf032820b146736c479c2cea465a37dbf;p=features.git Fix crash after 24926b2e239. The matched element may not have a parent. I guess the old version of setExpanded too care of that. Now we have to do so. --- diff --git a/src/frontends/qt/GuiPrefs.cpp b/src/frontends/qt/GuiPrefs.cpp index d716d8544a..98aa0c12b8 100644 --- a/src/frontends/qt/GuiPrefs.cpp +++ b/src/frontends/qt/GuiPrefs.cpp @@ -3266,7 +3266,8 @@ void PrefShortcuts::on_searchLE_textEdited() for (int i = 0; i < matched.size(); ++i) if (!isAlwaysHidden(*matched[i])) { matched[i]->setHidden(false); - matched[i]->parent()->setExpanded(true); + if (matched[i]->parent()) + matched[i]->parent()->setExpanded(true); } }