On 02/12/2018 04:27 PM, Richard Heck wrote:
> commit 5ee3396459602e0982234cab064c5c960af7e4fc
> Author: Richard Heck <rgh...@lyx.org>
> Date:   Mon Feb 12 16:26:27 2018 -0500
>
>     Fix crash when citeengine is unknown.

Scott, this is also needed in 2.3.x. Trivial and completely safe crash-fix.

Richard


> ---
>  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 85318bc..8149b50 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";
>  }
>  


Reply via email to