mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
avoid a crash on empty documents (bug 4859)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28345 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9622577c60
commit
deac053e36
12
src/Text.cpp
12
src/Text.cpp
@ -1298,8 +1298,18 @@ bool Text::read(Buffer const & buf, Lexer & lex,
|
||||
if (token == "\\begin_body")
|
||||
continue;
|
||||
|
||||
if (token == "\\end_document")
|
||||
if (token == "\\end_document") {
|
||||
// avoid a crash on weird documents (bug 4859)
|
||||
if (pars_.empty()) {
|
||||
Paragraph par;
|
||||
par.setInsetOwner(insetPtr);
|
||||
par.params().depth(depth);
|
||||
par.setFont(0, Font(inherit_font,
|
||||
buf.params().language));
|
||||
pars_.push_back(par);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (token == "\\begin_layout") {
|
||||
lex.pushToken(token);
|
||||
|
Loading…
Reference in New Issue
Block a user