From: Jean-Marc Lasgouttes Date: Mon, 9 Sep 2024 13:35:57 +0000 (+0200) Subject: Do not access current_view_ if it is NULL X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=ffde470363c0bfafc915751fa788a34d4c9e06b8;p=lyx.git Do not access current_view_ if it is NULL Spotted by Coverity scan. --- diff --git a/src/frontends/qt/GuiApplication.cpp b/src/frontends/qt/GuiApplication.cpp index a4c8b328b3..1c9edc0c9c 100644 --- a/src/frontends/qt/GuiApplication.cpp +++ b/src/frontends/qt/GuiApplication.cpp @@ -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));