Merge pull request #146 from throrin19/patch-node

fix null error if element defs not exist.
master
Dmitry Baranovskiy 2013-12-19 17:01:46 -08:00
commit 57dbdddf73
1 changed files with 2 additions and 1 deletions

View File

@ -1279,7 +1279,8 @@ function getSomeDefs(el) {
(el.node.parentNode && wrap(el.node.parentNode)) || (el.node.parentNode && wrap(el.node.parentNode)) ||
Snap.select("svg") || Snap.select("svg") ||
Snap(0, 0), Snap(0, 0),
defs = p.select("defs").node; pdefs = p.select("defs"),
defs = pdefs == null ? false : pdefs.node;
if (!defs) { if (!defs) {
defs = make("defs", p.node).node; defs = make("defs", p.node).node;
} }