From f0be34d40fdb5840cb2ad4539db4f6dd3978cb3f Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Thu, 30 Nov 2017 22:04:34 +0100 Subject: Extensions: Don't crash on invalid effect extension output --- src/extension/implementation/script.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/extension/implementation/script.cpp') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index eb98711bc..23c97c3b0 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -732,9 +732,14 @@ void Script::effect(Inkscape::Extension::Effect *module, SPDocument * mydoc = NULL; if (data_read > 10) { - mydoc = Inkscape::Extension::open( - Inkscape::Extension::db.get(SP_MODULE_KEY_INPUT_SVG), - tempfilename_out.c_str()); + try { + mydoc = Inkscape::Extension::open( + Inkscape::Extension::db.get(SP_MODULE_KEY_INPUT_SVG), + tempfilename_out.c_str()); + } catch (const Inkscape::Extension::Input::open_failed &e) { + /// \todo Popup dialog here + g_warning("Extension returned output that could not be parsed: %s", e.what()); + } } // data_read pump_events(); -- cgit v1.2.3