commit 0dfca93139d15e851725bd6d9d6098ef09c1ca8d Author: Richard Heck <rgh...@lyx.org> Date: Mon Feb 12 16:26:27 2018 -0500
Fix crash when citeengine is unknown. (cherry picked from commit 5ee3396459602e0982234cab064c5c960af7e4fc) --- src/frontends/qt4/GuiDocument.cpp | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 524ea39..0920378 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"; }