This patch fixes the crash caused by loading the attached empty corrupted document.

Comments?

Abdel.

Index: buffer.C
===================================================================
--- buffer.C    (revision 14826)
+++ buffer.C    (working copy)
@@ -566,14 +566,15 @@
        paragraphs().clear();
        LyXLex lex(0, 0);
        lex.setFile(filename);
-       bool ret = readFile(lex, filename);
+       if (!readFile(lex, filename))
+               return false;
 
        // After we have read a file, we must ensure that the buffer
        // language is set and used in the gui.
        // If you know of a better place to put this, please tell me. (Lgb)
        updateDocLang(params().language);
 
-       return ret;
+       return true;
 }
 
 
Index: frontends/LyXView.C
===================================================================
--- frontends/LyXView.C (revision 14826)
+++ frontends/LyXView.C (working copy)
@@ -162,7 +162,6 @@
                disconnectBuffer();
 
        bool loaded = work_area_->bufferView().loadLyXFile(filename, 
tolastfiles);
-       showErrorList("Parse");
 
        updateMenubar();
        updateToolbars();
@@ -171,6 +170,7 @@
        if (loaded) {
                connectBuffer(*work_area_->bufferView().buffer());
                setLayout(work_area_->bufferView().firstLayout());
+               showErrorList("Parse");
        }
        redrawWorkArea();
        return loaded;


Reply via email to