Do not access current_view_ if it is NULL

Spotted by Coverity scan.
This commit is contained in:
Jean-Marc Lasgouttes 2024-09-09 15:35:57 +02:00
parent 3d323412ad
commit ffde470363

View 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));