From 08cfe6c46b3c369cfeaeab04361e62ff273e298c Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Mon, 16 May 2011 18:17:39 +0000 Subject: [PATCH] Check the return status of Lexer::setFile(). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38778 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Buffer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 9d102acd9a..ea1168b684 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -873,7 +873,12 @@ Buffer::ReadStatus Buffer::readFile(FileName const & fn) { FileName fname(fn); Lexer lex; - lex.setFile(fname); + if (!lex.setFile(fname)) { + Alert::error(_("File Not Found"), + bformat(_("Unable to open file `%1$s'."), + from_utf8(fn.absFileName()))); + return ReadFileNotFound; + } int file_format; ReadStatus const ret_plf = parseLyXFormat(lex, fn, file_format);