]> git.lyx.org Git - lyx.git/commitdiff
Do not access current_view_ if it is NULL
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 9 Sep 2024 13:35:57 +0000 (15:35 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 9 Sep 2024 13:35:57 +0000 (15:35 +0200)
Spotted by Coverity scan.

src/frontends/qt/GuiApplication.cpp

index a4c8b328b3eaf591d7fcbdd6146c941174a3aace..1c9edc0c9c658c60bec45ba84db9d1c461bb151b 100644 (file)
@@ -1902,7 +1902,8 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        // set default
                        arg = "templates";
                if (arg != "templates" && arg != "examples") {
-                       current_view_->message(_("Wrong argument. Must be 'examples' or 'templates'."));
+                       if (current_view_)
+                               current_view_->message(_("Wrong argument. Must be 'examples' or 'templates'."));
                        break;
                }
                lyx::dispatch(FuncRequest(LFUN_DIALOG_SHOW, "lyxfiles " + arg));