Avoid empty d attributes in SVG nodes, since they throw errors.

This commit is contained in:
Jürg Lehni 2013-03-01 21:29:45 -08:00
parent 936b1bccbb
commit a63e8ac54c

View file

@ -216,9 +216,8 @@ new function() {
case 'empty': case 'empty':
return null; return null;
case 'path': case 'path':
attrs = { var data = item.getPathData();
d: item.getPathData() attrs = data && { d: data };
};
break; break;
case 'polyline': case 'polyline':
case 'polygon': case 'polygon':
@ -307,7 +306,9 @@ new function() {
function exportCompoundPath(item) { function exportCompoundPath(item) {
var attrs = getTransform(item, true); var attrs = getTransform(item, true);
attrs.d = item.getPathData(); var data = item.getPathData();
if (data)
attrs.d = data;
return createElement('path', attrs); return createElement('path', attrs);
} }