]> git.lyx.org Git - features.git/commitdiff
Check that DocIterator::sanitize only adds editable insets
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 9 Mar 2015 10:14:26 +0000 (11:14 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 10 Mar 2015 15:17:29 +0000 (16:17 +0100)
This fixes the crash on ticket #9432, but the bug there has other causes.

src/DocIterator.cpp

index 859aae9ddda07f00956c1397cd1d7aec33264ddb..e574115c31be85de4349a1ef7ab1e60db2e19f2a 100644 (file)
@@ -555,6 +555,11 @@ void DocIterator::sanitize()
                        fixIfBroken();
                        break;
                }
+               if (!inset->editable()) {
+                       LYXERR0("Inset found on cursor stack is not editable.");
+                       fixIfBroken();
+                       break;
+               }
                push_back(sl[i]);
                top().inset_ = inset;
                if (fixIfBroken())