]> git.lyx.org Git - features.git/commitdiff
Fix a crash in adv F&R when the a manual could not be loaded
authorVincent van Ravesteijn <vfr@lyx.org>
Thu, 27 Oct 2011 09:31:17 +0000 (09:31 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Thu, 27 Oct 2011 09:31:17 +0000 (09:31 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40027 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/FindAndReplace.cpp

index 0801d4b66420798dd1dd28a234b9b91678d5ecb9..9f7f567d21abf9f9136cc010cf59cce43e9b9bf4 100644 (file)
@@ -305,6 +305,11 @@ bool FindAndReplaceWidget::findAndReplaceScope(FindAndReplaceOptions & opt, bool
                                guiApp->currentView()->setBusy(true);
                        }
                        buf = theBufferList().getBuffer(fname);
+                       if (!buf) {
+                               view_.setBusy(false);
+                               return false;
+                       }
+
                        lyx::dispatch(FuncRequest(LFUN_BUFFER_SWITCH,
                                                  buf->absFileName()));
                        bv = view_.documentBufferView();
@@ -327,7 +332,9 @@ bool FindAndReplaceWidget::findAndReplaceScope(FindAndReplaceOptions & opt, bool
 
                // No match found in current buffer (however old selection might have been replaced)
                // select next buffer in scope, if any
-               bool prompt = nextPrevBuffer(buf, opt);
+               bool const prompt = nextPrevBuffer(buf, opt);
+               if (!buf)
+                       break;
                if (prompt) {
                        if (wrap_answer != -1)
                                break;