commit c86f9d81e704fa9f8becb178dba54f7bd94bb105
Author: Enrico Forestieri <for...@lyx.org>
Date:   Mon Jun 12 21:24:52 2017 +0200

    Avoid a crash if an external template is not installed
---
 src/frontends/qt4/GuiExternal.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/frontends/qt4/GuiExternal.cpp 
b/src/frontends/qt4/GuiExternal.cpp
index 6579032..f940a73 100644
--- a/src/frontends/qt4/GuiExternal.cpp
+++ b/src/frontends/qt4/GuiExternal.cpp
@@ -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.

Reply via email to