From 1406a544206c894f8a007b75b6bf6faa49ad4cc0 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 10 Jan 2008 08:46:04 +0000 Subject: [PATCH] * 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 --- src/CursorSlice.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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()); } -- 2.39.2