From: dooglus Date: Thu, 7 Feb 2008 23:34:43 +0000 (+0000) Subject: Prevent a crash when loading a .sif file with 'use=""' in it. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=42f7fccb005cc4a4ab985e01398ab6479bb62199;p=synfig.git Prevent a crash when loading a .sif file with 'use=""' in it. git-svn-id: http://svn.voria.com/code@1622 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/loadcanvas.cpp b/synfig-core/trunk/src/synfig/loadcanvas.cpp index c59075e..00cbfc2 100644 --- a/synfig-core/trunk/src/synfig/loadcanvas.cpp +++ b/synfig-core/trunk/src/synfig/loadcanvas.cpp @@ -1694,7 +1694,9 @@ CanvasParser::parse_layer(xmlpp::Element *element,Canvas::Handle canvas) String str= child->get_attribute("use")->get_value(); - if(layer->get_param(param_name).get_type()==ValueBase::TYPE_CANVAS) + if (str.empty()) + error(child,_("Empty use=\"\" value in ")); + else if(layer->get_param(param_name).get_type()==ValueBase::TYPE_CANVAS) { if(!layer->set_param(param_name,canvas->surefind_canvas(str))) error((*iter),_("Layer rejected canvas link"));