]> git.lyx.org Git - lyx.git/blobdiff - src/DocIterator.cpp
Do not overwrite read-only files. We now move the file to the backup directory and...
[lyx.git] / src / DocIterator.cpp
index 2c244ae2e11c224f20429b8eb764927084eeb404..3af7dcba93b96762e5055b8a8c6479ae89cdb38b 100644 (file)
@@ -91,8 +91,11 @@ DocIterator DocIterator::clone(Buffer * buffer) const
 
 bool DocIterator::inRegexped() const
 {
-       InsetMathHull * i = inset().asInsetMath()->asHullInset();
-       return i && i->getType() == hullRegexp;
+       InsetMath * im = inset().asInsetMath();
+       if (!im) 
+               return false;
+       InsetMathHull * hull = im->asHullInset();
+       return hull && hull->getType() == hullRegexp;
 }