From ffde470363c0bfafc915751fa788a34d4c9e06b8 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 9 Sep 2024 15:35:57 +0200 Subject: [PATCH] Do not access current_view_ if it is NULL Spotted by Coverity scan. --- src/frontends/qt/GuiApplication.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)); -- 2.39.5