From f14ce3f2ef0d7117636fec92bc3a0c4d6a36fe81 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 31 Mar 2017 13:38:35 +0200 Subject: [PATCH] Handle exception thrown by Buffer::emergencyWrite Spotted by coverity --- src/Buffer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index a966f6dbb8..17516fe13c 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -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); }