fix null error if element defs not exist.

master
Benjamin Besse 2013-12-12 14:05:36 +01:00
parent ea53281607
commit 2538ee19b1
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)) ||
Snap.select("svg") ||
Snap(0, 0),
defs = p.select("defs").node;
pdefs = p.select("defs"),
defs = pdefs == null ? false : pdefs.node;
if (!defs) {
defs = make("defs", p.node).node;
}