]> git.lyx.org Git - features.git/commitdiff
Do not crash with empty (invalid) math environments (part of #8359)
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 10 Feb 2014 08:24:14 +0000 (09:24 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 10 Feb 2014 08:24:14 +0000 (09:24 +0100)
src/mathed/MathParser.cpp

index 05ceed80f251bf6d78f210276f8a03e8cf8b1b01..ef987789b319a0e7b045d78d3f868eb1fba70e61 100644 (file)
@@ -1528,6 +1528,13 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
 
                else if (t.cs() == "begin") {
                        docstring const name = getArg('{', '}');
+                       
+                       if (name.empty()) {
+                               success_ = false;
+                               error("found invalid environment");
+                               return success_;
+                       }
+                       
                        environments_.push_back(name);
 
                        if (name == "array" || name == "subarray") {