From: Abdelrazak Younes Date: Thu, 10 Jan 2008 08:46:04 +0000 (+0000) Subject: * CursorSlice::lastpos(): check for text emptiness (should fix a crash when releasing... X-Git-Tag: 1.6.10~6672 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=1406a544206c894f8a007b75b6bf6faa49ad4cc0;p=lyx.git * CursorSlice::lastpos(): check for text emptiness (should fix a crash when releasing an empty buffer). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22474 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/CursorSlice.cpp b/src/CursorSlice.cpp index f4319dcf01..af6d978947 100644 --- a/src/CursorSlice.cpp +++ b/src/CursorSlice.cpp @@ -61,7 +61,8 @@ Paragraph & CursorSlice::paragraph() const pos_type CursorSlice::lastpos() const { BOOST_ASSERT(inset_); - return inset_->asInsetMath() ? cell().size() : paragraph().size(); + return inset_->asInsetMath() ? cell().size() + : (text()->empty() ? 0 : paragraph().size()); }