Amend [2dcb7300/lyxgit]

Avoid a crash by checking that a cell is not empty before
accessing its content.
This commit is contained in:
Enrico Forestieri 2019-01-02 09:08:39 +01:00
parent 71dfcb18b9
commit b3cba2a09c

View 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)