]> git.lyx.org Git - features.git/commitdiff
Amend [324b8287/lyxgit]
authorEnrico Forestieri <forenr@lyx.org>
Wed, 2 Jan 2019 08:22:56 +0000 (09:22 +0100)
committerEnrico Forestieri <forenr@lyx.org>
Wed, 2 Jan 2019 08:22:56 +0000 (09:22 +0100)
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

index f37b73b9635df1652931ac5022c4e06cbb29c0c3..d1bb67d59652e2c5376474807230892b9768ca9e 100644 (file)
@@ -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)