From 9065f48ead964206b073fb332bbea38adfa2acea Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sun, 31 Jan 2010 16:20:47 +0000 Subject: [PATCH] Add an assert to check for a fully loaded Buffer before trying to save it. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33295 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Buffer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 02634402cf..09560ab781 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -1118,6 +1118,13 @@ docstring Buffer::emergencyWrite() bool Buffer::write(ostream & ofs) const { + // Do not try to save the buffer if it is for some + // reason not fully loaded. + if (!d->file_fully_loaded) { + LYXERR0("WARNING: file was not fully loaded when trying to save."); + LASSERT(d->file_fully_loaded, return false); + } + #ifdef HAVE_LOCALE // Use the standard "C" locale for file output. ofs.imbue(locale::classic()); -- 2.39.2