summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-02-12 13:49:38 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-03-01 02:08:58 +0100
commit981c1fb154e3999f91dd9c1eff97726d689240ff (patch)
tree2a71af12854deefdb88a9a27f5f46286128eabb3
parent64a5c17b95393c0914670b1b9e2c8b4d63707968 (diff)
downloadsvg.js-981c1fb154e3999f91dd9c1eff97726d689240ff.tar.gz
svg.js-981c1fb154e3999f91dd9c1eff97726d689240ff.zip
return explicit null if there is no root
-rw-r--r--src/doc.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/doc.js b/src/doc.js
index 843ff03..d4bf7e5 100644
--- a/src/doc.js
+++ b/src/doc.js
@@ -23,7 +23,9 @@ SVG.Doc = SVG.invent({
if(parent.isRoot()) return parent
}
- throw new Error('This should never be reached')
+ // this can only happen when you have something like
+ // <g><svg>...</svg></g>
+ return null
},
// Add namespaces
namespace: function() {