From a63e8ac54c68a71ba0fbb0092edffd6183d9185a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 1 Mar 2013 21:29:45 -0800 Subject: [PATCH] Avoid empty d attributes in SVG nodes, since they throw errors. --- src/svg/SvgExport.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/svg/SvgExport.js b/src/svg/SvgExport.js index e7f1b782..a4053012 100644 --- a/src/svg/SvgExport.js +++ b/src/svg/SvgExport.js @@ -216,9 +216,8 @@ new function() { case 'empty': return null; case 'path': - attrs = { - d: item.getPathData() - }; + var data = item.getPathData(); + attrs = data && { d: data }; break; case 'polyline': case 'polygon': @@ -307,7 +306,9 @@ new function() { function exportCompoundPath(item) { var attrs = getTransform(item, true); - attrs.d = item.getPathData(); + var data = item.getPathData(); + if (data) + attrs.d = data; return createElement('path', attrs); }