]> git.lyx.org Git - features.git/commitdiff
Prevent assertion with command 'buffer-switch xxx' in which xxx is not the name of...
authorVincent van Ravesteijn <vfr@lyx.org>
Sun, 29 Mar 2009 02:29:15 +0000 (02:29 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sun, 29 Mar 2009 02:29:15 +0000 (02:29 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28966 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp

index 4c0f10506c4cbd6995a77a2e5d9914194c45bd81..867aa0e2fb994c3436134564a5c01c695376d8e2 100644 (file)
@@ -1963,9 +1963,15 @@ bool GuiView::dispatch(FuncRequest const & cmd)
                        importDocument(to_utf8(cmd.argument()));
                        break;
 
-               case LFUN_BUFFER_SWITCH:
-                       setBuffer(theBufferList().getBuffer(FileName(to_utf8(cmd.argument()))));
+               case LFUN_BUFFER_SWITCH: {
+                       Buffer * buffer = 
+                               theBufferList().getBuffer(FileName(to_utf8(cmd.argument())));
+                       if (buffer)
+                               setBuffer(buffer);
+                       else
+                               bv->cursor().message(_("Document not loaded"));
                        break;
+               }
 
                case LFUN_BUFFER_NEXT:
                        gotoNextOrPreviousBuffer(NEXTBUFFER);