From: dooglus Date: Sun, 2 Nov 2008 17:24:35 +0000 (+0000) Subject: Fix 1968248: "Opening of any other XML-file crashes synfigstudio". Attempting to... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=dc48c477a00bfc7508654d698ffc14a12698a693;p=synfig.git Fix 1968248: "Opening of any other XML-file crashes synfigstudio". Attempting to open a non-SIF format XML file will now produce an error message, not a crash. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2142 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/loadcanvas.cpp b/synfig-core/trunk/src/synfig/loadcanvas.cpp index ed2d350..cf01a8c 100644 --- a/synfig-core/trunk/src/synfig/loadcanvas.cpp +++ b/synfig-core/trunk/src/synfig/loadcanvas.cpp @@ -2097,6 +2097,7 @@ CanvasParser::parse_from_file_as(const String &file_,const String &as_,String &e if(parser) { Canvas::Handle canvas(parse_canvas(parser.get_document()->get_root_node(),0,false,as)); + if (!canvas) return canvas; get_open_canvas_map()[etl::absolute_path(as)]=canvas; canvas->signal_deleted().connect(sigc::bind(sigc::ptr_fun(_remove_from_open_canvas_map),canvas.get())); canvas->signal_file_name_changed().connect(sigc::bind(sigc::ptr_fun(_canvas_file_name_changed),canvas.get()));