]> git.lyx.org Git - lyx.git/commitdiff
Fix crash when session is empty.
authorAbdelrazak Younes <younes@lyx.org>
Wed, 22 Aug 2007 08:34:48 +0000 (08:34 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 22 Aug 2007 08:34:48 +0000 (08:34 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19716 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyX.cpp

index 9acbceb541357f655f11792cbec5867ce2fa9558..4f3fd68881df798d6aeae8cc70646676f96cafa1 100644 (file)
@@ -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());
 }