]> O.S.I.I.S - jp/crow.git/commitdiff
add error handling for CrowType not found in group children
authorjp <jp_bruyere@hotmail.com>
Wed, 3 Feb 2016 10:59:24 +0000 (11:59 +0100)
committerjp <jp_bruyere@hotmail.com>
Wed, 3 Feb 2016 10:59:24 +0000 (11:59 +0100)
src/GraphicObjects/Group.cs

index 087cd38d5f0a52ce577a4607f1cd5c741dd5239a..5107ccc5da620484188acfbb706ab857a61c057a 100644 (file)
@@ -290,6 +290,8 @@ namespace Crow
                         break;
 
                     Type t = Type.GetType("Crow." + subTree.Name);
+                                       if (t == null)
+                                               throw new Exception ("Crow." + subTree.Name + " type not found");
                     GraphicObject go = (GraphicObject)Activator.CreateInstance(t);
                     (go as IXmlSerializable).ReadXml(subTree);                    
                     addChild(go);