]> git.lyx.org Git - lyx.git/commitdiff
Avoid a crash if an external template is not installed
authorEnrico Forestieri <forenr@lyx.org>
Mon, 12 Jun 2017 19:24:52 +0000 (21:24 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Mon, 12 Jun 2017 19:24:52 +0000 (21:24 +0200)
src/frontends/qt4/GuiExternal.cpp

index 65790327bb88b7f20b7886074d31743620c3d8fc..f940a7301006fe1041409aa6a38f790d6593b619 100644 (file)
@@ -525,7 +525,10 @@ void GuiExternal::updateTemplate()
                external::TemplateManager::get();
        external::Template const * const templ = etm.getTemplateByName(
                fromqstr(externalCO->itemData(externalCO->currentIndex()).toString()));
-       externalTB->setPlainText(toqstr(translateIfPossible(templ->helpText)));
+       externalTB->setPlainText(toqstr(translateIfPossible(
+                               templ ? templ->helpText : docstring())));
+       if (!templ)
+               return;
 
        // Ascertain which (if any) transformations the template supports
        // and disable tabs and Group Boxes hosting unsupported transforms.