From: Richard Heck Date: Mon, 12 Feb 2018 21:26:27 +0000 (-0500) Subject: Fix crash when citeengine is unknown. X-Git-Tag: lyx-2.4.0dev-acb2ca7b~3878 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5ee3396459602e0982234cab064c5c960af7e4fc;p=features.git Fix crash when citeengine is unknown. --- diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 85318bc7f0..8149b5070f 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -4007,6 +4007,12 @@ bool GuiDocument::isBiblatex() const biblioModule->citeEngineCO->itemData( biblioModule->citeEngineCO->currentIndex()).toString(); + // this can happen if the cite engine is unknown, which can happen + // if one is using a file that came from someone else, etc. in that + // case, we crash if we proceed. + if (engine.isEmpty()) + return false; + return theCiteEnginesList[fromqstr(engine)]->getCiteFramework() == "biblatex"; }