]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathNest.cpp
Fix bug #6989: Be somewhat more secure with the homebrew dynamic asserts that were...
[features.git] / src / mathed / InsetMathNest.cpp
index d0c2397a2e47b5fdb1e020b94421fb14cff8ddd9..4a455a1485cd242ebf5cc29bcc17546f5e0cf892 100644 (file)
@@ -1011,10 +1011,13 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
        }
 
        case LFUN_REGEXP_MODE: {
-               InsetMathHull * i = cur.inset().asInsetMath()->asHullInset();           
-               if (i && i->getType() == hullRegexp) {
-                       cur.message(_("Already in regular expression mode"));
-                       break;
+               InsetMath * im = cur.inset().asInsetMath();
+               if (im) {
+                       InsetMathHull * i = im->asHullInset();          
+                       if (i && i->getType() == hullRegexp) {
+                               cur.message(_("Already in regular expression mode"));
+                               break;
+                       }
                }
                cur.macroModeClose();
                docstring const save_selection = grabAndEraseSelection(cur);