From e65e84878f93008006470db3372b8ee7bf994872 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Wed, 2 Jan 2019 09:22:56 +0100 Subject: [PATCH] Amend [324b8287/lyxgit] Avoid a crash by checking that a cell is not empty before accessing its content. No status line is needed as this amends a previous commit. --- 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