From: Ulrich-Matthias Schäfer Date: Mon, 12 Feb 2018 12:49:38 +0000 (+0100) Subject: return explicit null if there is no root X-Git-Tag: 3.0.0~66^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=981c1fb154e3999f91dd9c1eff97726d689240ff;p=svg.js.git return explicit null if there is no root --- 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 + // ... + return null }, // Add namespaces namespace: function() {