]> git.lyx.org Git - features.git/commitdiff
Fix crash when calling dialog-show with bogus names (#12873).
authorPavel Sanda <sanda@lyx.org>
Mon, 14 Aug 2023 21:54:47 +0000 (23:54 +0200)
committerPavel Sanda <sanda@lyx.org>
Mon, 14 Aug 2023 21:54:47 +0000 (23:54 +0200)
src/frontends/qt/GuiView.cpp

index 764921c46000eb55b45120af6aca4119a760c529..ddf7e8df85c1deb60a27b21789dac18d144da61f 100644 (file)
@@ -5310,14 +5310,17 @@ Dialog * GuiView::findOrBuild(string const & name, bool hide_it)
                return dialog;
 
        dialog = build(name);
-       d.dialogs_[name].reset(dialog);
-       // Force a uniform style for group boxes
-       // On Mac non-flat works better, on Linux flat is standard
-       flatGroupBoxes(dialog->asQWidget(), guiApp->platformName() != "cocoa");
-       if (lyxrc.allow_geometry_session)
-               dialog->restoreSession();
-       if (hide_it)
-               dialog->hideView();
+       if (dialog) {
+
+               d.dialogs_[name].reset(dialog);
+               // Force a uniform style for group boxes
+               // On Mac non-flat works better, on Linux flat is standard
+               flatGroupBoxes(dialog->asQWidget(), guiApp->platformName() != "cocoa");
+               if (lyxrc.allow_geometry_session)
+                       dialog->restoreSession();
+               if (hide_it)
+                       dialog->hideView();
+               }
        return dialog;
 }