From: Abdelrazak Younes Date: Wed, 22 Aug 2007 08:34:48 +0000 (+0000) Subject: Fix crash when session is empty. X-Git-Tag: 1.6.10~8758 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2419c80657f0b285e9634d62fce3277aa7d706c2;p=lyx.git Fix crash when session is empty. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19716 a592a061-630c-0410-9148-cb99ea01b6c8 --- 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()); }