diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 8129ab3ef8..ababd24a94 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1886,9 +1886,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); diff --git a/status.16x b/status.16x index d122862024..5c2d359be0 100644 --- a/status.16x +++ b/status.16x @@ -117,6 +117,9 @@ What's new of the date-insert function. This fixes a crash on Windows with invalid/ unsupported date specifiers (bug 5827). +- Fix crash when issuing the command "buffer-switch " and there + is no buffer called . + - Adjust the color of deletions slightly when using change tracking. It is now easier to distinguish between added and deleted text (bug 5629).