Fix 1968248: "Opening of any other XML-file crashes synfigstudio". Attempting to...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 2 Nov 2008 17:24:35 +0000 (17:24 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 2 Nov 2008 17:24:35 +0000 (17:24 +0000)
git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2142 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/loadcanvas.cpp

index ed2d350..cf01a8c 100644 (file)
@@ -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()));