Avoid exception when using SVG Tiny 1.2 definitions file.
authorCameron McCormack <cam@mcc.id.au>
Sat, 06 Apr 2013 16:37:10 +1100
changeset 76 cf60bdf06b8d
parent 75 499d59804682
child 77 c442b4de16ac
Avoid exception when using SVG Tiny 1.2 definitions file.
publish/definitions.js
--- a/publish/definitions.js	Sat Apr 06 16:36:59 2013 +1100
+++ b/publish/definitions.js	Sat Apr 06 16:37:10 2013 +1100
@@ -433,9 +433,11 @@
     for (var i = 0; i < element.attributeCategories.length; i++) {
       var catName = element.attributeCategories[i];
       var cat = defs.attributeCategories[catName];
-      for (var j = 0; j < cat.attributes.length; j++) {
-        element.attributes[cat.attributes[j].name] = cat.attributes[j];
-        element.attributeOrder.push(cat.attributes[j].name);
+      if (cat) {
+        for (var j = 0; j < cat.attributes.length; j++) {
+          element.attributes[cat.attributes[j].name] = cat.attributes[j];
+          element.attributeOrder.push(cat.attributes[j].name);
+        }
       }
     }
     for (var i = 0; i < defs.commonAttributesForElements.length; i++) {