]> git.lyx.org Git - features.git/commitdiff
Don't try to load a nonexisting file when executing server-goto-file-row
authorEnrico Forestieri <forenr@lyx.org>
Sun, 26 Apr 2009 22:52:22 +0000 (22:52 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Sun, 26 Apr 2009 22:52:22 +0000 (22:52 +0000)
as this leads to a crash.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29418 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyXFunc.cpp

index 4c1d579c42dc46e6687f896caf44fe1059a41f74..5892a27cd5c213e2e94db22e2fff9dfe5a68121f 100644 (file)
@@ -1090,10 +1090,13 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                // Either change buffer or load the file
                                if (theBufferList().exists(s))
                                        buf = theBufferList().getBuffer(s);
-                               else {
+                               else if (s.exists()) {
                                        buf = lyx_view_->loadDocument(s);
                                        loaded = true;
-                               }
+                               } else
+                                       lyx_view_->message(bformat(
+                                               _("File does not exist: %1$s"),
+                                               makeDisplayPath(file_name)));
                        }
 
                        if (!buf) {