]> git.lyx.org Git - features.git/commitdiff
Fix crash after 24926b2e239.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Sat, 28 Mar 2020 19:23:13 +0000 (15:23 -0400)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:55 +0000 (15:48 +0200)
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.

src/frontends/qt/GuiPrefs.cpp

index d716d8544a6707e42dcb27528f5a904c1a045bfd..98aa0c12b86cb52464e92c0c720b27a3926cd7ba 100644 (file)
@@ -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);
                }
 }