From 2419c80657f0b285e9634d62fce3277aa7d706c2 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Wed, 22 Aug 2007 08:34:48 +0000 Subject: [PATCH] Fix crash when session is empty. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19716 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/LyX.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/LyX.cpp b/src/LyX.cpp index 9acbceb541..4f3fd68881 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -664,7 +664,8 @@ void LyX::restoreGuiSession() // FIXME: Switch to the last loaded Buffer. This must not be the first one // because the Buffer won't be connected in this case. The correct solution // would be to avoid the manual connection of the current Buffer in LyXView. - view->setBuffer(pimpl_->buffer_list_.last()); + if (!pimpl_->buffer_list_.empty()) + view->setBuffer(pimpl_->buffer_list_.last()); } -- 2.39.5