From b7665042ff81d577f2ad4fbfb3a2bfbc5645bc7f Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Thu, 10 Feb 2005 20:15:14 +0000 Subject: [PATCH] fix inInset crash git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9609 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/text2.C | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index cdca927836..3fa669d737 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-02-10 Georg Baum + + * text2.C (setCounter): check for inInset() == 0 + 2005-02-09 Jean-Marc Lasgouttes * BufferView_pimpl.C (dispatch): handle LFUN_GOTO_PARAGRAPH here, diff --git a/src/text2.C b/src/text2.C index 2fd76bc774..5f2b91d77f 100644 --- a/src/text2.C +++ b/src/text2.C @@ -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; }