diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2016-02-10 21:12:36 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2016-02-10 21:12:36 +0100 |
commit | 3b388c64789c3d589e0e6d194aa87864f1cd958e (patch) | |
tree | 13ed25b0080c67ae6df40d9018cdd59100c7f1dc | |
parent | 85288fe5c3baafb26737a78f030bc67453ec9aeb (diff) | |
parent | 2c1bf5a4095df2d15f36ea5a3341bf9a9a133217 (diff) | |
download | svg.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.js | 2 |
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) } |