summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2016-02-10 21:12:36 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2016-02-10 21:12:36 +0100
commit3b388c64789c3d589e0e6d194aa87864f1cd958e (patch)
tree13ed25b0080c67ae6df40d9018cdd59100c7f1dc
parent85288fe5c3baafb26737a78f030bc67453ec9aeb (diff)
parent2c1bf5a4095df2d15f36ea5a3341bf9a9a133217 (diff)
downloadsvg.js-3b388c64789c3d589e0e6d194aa87864f1cd958e.tar.gz
svg.js-3b388c64789c3d589e0e6d194aa87864f1cd958e.zip
Merge pull request #447 from assembler/patch-1
Uncaught TypeError: Cannot read property 'node' of null
-rw-r--r--src/element.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/element.js b/src/element.js
index 090459f..75d77dc 100644
--- a/src/element.js
+++ b/src/element.js
@@ -171,7 +171,7 @@ SVG.Element = SVG.invent({
if(!type) return parent
// loop trough ancestors if type is given
- while(parent.node instanceof SVGElement){
+ while(parent && parent.node instanceof SVGElement){
if(typeof type === 'string' ? parent.matches(type) : parent instanceof type) return parent
parent = SVG.adopt(parent.node.parentNode)
}