commit b3cba2a09cf751d0cd5b1d0cfbe43d76caf6e1b1
Author: Enrico Forestieri <for...@lyx.org>
Date:   Wed Jan 2 09:08:39 2019 +0100

    Amend [2dcb7300/lyxgit]
    
    Avoid a crash by checking that a cell is not empty before
    accessing its content.
---
 src/mathed/InsetMathMacro.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mathed/InsetMathMacro.cpp b/src/mathed/InsetMathMacro.cpp
index f37b73b..d1bb67d 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)

Reply via email to