]> git.lyx.org Git - features.git/commitdiff
fix inInset crash
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 10 Feb 2005 20:15:14 +0000 (20:15 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 10 Feb 2005 20:15:14 +0000 (20:15 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9609 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/text2.C

index cdca9278365f386967d6c774a4b8d11f167e9509..3fa669d7378e45857e2d1656601d2c15d6f6148a 100644 (file)
@@ -1,3 +1,7 @@
+2005-02-10  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * text2.C (setCounter): check for inInset() == 0
+
 2005-02-09  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * BufferView_pimpl.C (dispatch): handle LFUN_GOTO_PARAGRAPH here,
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;
                                }