From: Pavel Sanda Date: Mon, 14 Aug 2023 21:54:47 +0000 (+0200) Subject: Fix crash when calling dialog-show with bogus names (#12873). X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=59360761813470e4aa939e960023664ac452aa7f;p=features.git Fix crash when calling dialog-show with bogus names (#12873). --- diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp index 764921c460..ddf7e8df85 100644 --- a/src/frontends/qt/GuiView.cpp +++ b/src/frontends/qt/GuiView.cpp @@ -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; }