From b3cba2a09cf751d0cd5b1d0cfbe43d76caf6e1b1 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Wed, 2 Jan 2019 09:08:39 +0100 Subject: [PATCH] Amend [2dcb7300/lyxgit] Avoid a crash by checking that a cell is not empty before accessing its content. --- src/mathed/InsetMathMacro.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mathed/InsetMathMacro.cpp b/src/mathed/InsetMathMacro.cpp index f37b73b963..d1bb67d596 100644 --- a/src/mathed/InsetMathMacro.cpp +++ b/src/mathed/InsetMathMacro.cpp @@ -1113,10 +1113,10 @@ void InsetMathMacro::write(WriteStream & os) const // delimiter-size-modifier macro (see #10497 and #11346) bool braced = false; size_type last = cell(i).size() - 1; - if (cell(i)[last].nucleus()->asUnknownInset()) { + if (cell(i).size() && cell(i)[last].nucleus()->asUnknownInset()) { latexkeys const * l = in_word_set(cell(i)[last].nucleus()->name()); braced = (l && l->inset == "big"); - } else if (cell(i)[0].nucleus()->asScriptInset()) { + } else if (cell(i).size() && cell(i)[0].nucleus()->asScriptInset()) { braced = cell(i)[0].nucleus()->asScriptInset()->nuc().empty(); } if (braced) -- 2.39.5