From 0dfca93139d15e851725bd6d9d6098ef09c1ca8d Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Mon, 12 Feb 2018 16:26:27 -0500 Subject: [PATCH] Fix crash when citeengine is unknown. (cherry picked from commit 5ee3396459602e0982234cab064c5c960af7e4fc) --- src/frontends/qt4/GuiDocument.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 524ea399b0..09203781f0 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"; }