]> git.lyx.org Git - features.git/blobdiff - src/text2.C
fix inInset crash
[features.git] / src / text2.C
index 2fd76bc774c332268b8f8d463f17c07ac95ee4f6..5f2b91d77f2453524276ec76364b41963b26a788 100644 (file)
@@ -791,8 +791,9 @@ void LyXText::setCounter(Buffer const & buf, pit_type pit)
                        bool isOK = false;
                        while (tmppit != end) {
                                in = pars_[tmppit].inInset();
-                               if (in->lyxCode() == InsetBase::FLOAT_CODE ||
-                                   in->lyxCode() == InsetBase::WRAP_CODE) {
+                               if (in &&
+                                   (in->lyxCode() == InsetBase::FLOAT_CODE ||
+                                    in->lyxCode() == InsetBase::WRAP_CODE)) {
                                        isOK = true;
                                        break;
                                }