mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Check if SVG nodes could be converted before adding them as children.
This commit is contained in:
parent
86a1a17b8d
commit
c49a0c6ad4
1 changed files with 5 additions and 2 deletions
|
@ -209,8 +209,11 @@ new function() {
|
||||||
// Override default SVG style on groups, then apply style.
|
// Override default SVG style on groups, then apply style.
|
||||||
attrs.fill = 'none';
|
attrs.fill = 'none';
|
||||||
var svg = createElement('g', attrs);
|
var svg = createElement('g', attrs);
|
||||||
for (var i = 0, l = children.length; i < l; i++)
|
for (var i = 0, l = children.length; i < l; i++) {
|
||||||
svg.appendChild(children[i].exportSvg());
|
var child = children[i].exportSvg();
|
||||||
|
if (child)
|
||||||
|
svg.appendChild(child);
|
||||||
|
}
|
||||||
return svg;
|
return svg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue