diff options
Diffstat (limited to 'src/element.js')
-rw-r--r-- | src/element.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/element.js b/src/element.js index ea8fedb..7f252f7 100644 --- a/src/element.js +++ b/src/element.js @@ -178,7 +178,7 @@ SVG.Element = SVG.invent({ // loop trough ancestors if type is given while(parent && parent.node instanceof window.SVGElement){ if(typeof type === 'string' ? parent.matches(type) : parent instanceof type) return parent - if(parent.node.parentNode.nodeName == '#document') return null // #720 + if(!parent.node.parentNode || parent.node.parentNode.nodeName == '#document') return null // #759, #720 parent = SVG.adopt(parent.node.parentNode) } } |