]> source.dussan.org Git - svg.js.git/commitdiff
return explicit null if there is no root
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>
Mon, 12 Feb 2018 12:49:38 +0000 (13:49 +0100)
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>
Thu, 1 Mar 2018 01:08:58 +0000 (02:08 +0100)
src/doc.js

index 843ff0351a06d33c2251a4171fbb227e42dd030f..d4bf7e59368a26b3dbcdc8ee0d014619da1526e9 100644 (file)
@@ -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() {