From 981c1fb154e3999f91dd9c1eff97726d689240ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ulrich-Matthias=20Sch=C3=A4fer?= Date: Mon, 12 Feb 2018 13:49:38 +0100 Subject: [PATCH] return explicit null if there is no root --- src/doc.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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() { -- 2.39.5