Prevent a crash when loading a .sif file with 'use=""' in it.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 7 Feb 2008 23:34:43 +0000 (23:34 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 7 Feb 2008 23:34:43 +0000 (23:34 +0000)
git-svn-id: http://svn.voria.com/code@1622 1f10aa63-cdf2-0310-b900-c93c546f37ac

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

index c59075e..00cbfc2 100644 (file)
@@ -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 <param>"));
+                               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"));