]> git.lyx.org Git - features.git/blobdiff - src/mathed/MathMacro.cpp
Fix bug #6989: Be somewhat more secure with the homebrew dynamic asserts that were...
[features.git] / src / mathed / MathMacro.cpp
index da398683b029062d5eb66e79c58a5f3803de1c71..3e4f4409901b3e9a490cd0f7a2ae06af37d411d5 100644 (file)
@@ -164,9 +164,12 @@ bool MathMacro::editMode(BufferView const * bv) const {
                        // look if there is no other macro in edit mode above
                        ++i;
                        for (; i != cur.depth(); ++i) {
-                               MathMacro const * macro = cur[i].asInsetMath()->asMacro();
-                               if (macro && macro->displayMode() == DISPLAY_NORMAL)
-                                       return false;
+                               InsetMath * im = cur[i].asInsetMath();
+                               if (im) {
+                                       MathMacro const * macro = im->asMacro();
+                                       if (macro && macro->displayMode() == DISPLAY_NORMAL)
+                                               return false;
+                               }
                        }
 
                        // ok, none found, I am the highest one