Handle exception thrown by Buffer::emergencyWrite

Spotted by coverity
This commit is contained in:
Jean-Marc Lasgouttes 2017-03-31 13:38:35 +02:00
parent 6b2444a7df
commit f14ce3f2ef

View File

@ -553,7 +553,11 @@ Buffer::~Buffer()
if (!isClean()) {
docstring msg = _("LyX attempted to close a document that had unsaved changes!\n");
msg += emergencyWrite();
try {
msg += emergencyWrite();
} catch (...) {
msg += " " + _("Save failed! Bummer. Document is lost.");
}
Alert::warning(_("Attempting to close changed document!"), msg);
}