diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 3a3f88bcf8..e507ca3c31 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1613,8 +1613,13 @@ void GuiView::newDocument(string const & filename, bool from_template) initpath = trypath; } - string templatefile = from_template ? - selectTemplateFile().absFilename() : string(); + string templatefile; + if (from_template) { + templatefile = selectTemplateFile().absFilename(); + if (templatefile.empty()) + return; + } + Buffer * b; if (filename.empty()) b = newUnnamedFile(templatefile, initpath);