diff --git a/modules/domQueries/scope.js b/modules/domQueries/scope.js index 5ebdb7410..7ee1e9f28 100644 --- a/modules/domQueries/scope.js +++ b/modules/domQueries/scope.js @@ -58,7 +58,7 @@ var context = phantomas.getDOMPath(this); // querying by BODY and body is the same (issue #419) - tagName = tagName.toLowerCase(); + if (tagName) tagName = tagName.toLowerCase(); phantomas.incrMetric("DOMqueriesByTagName"); phantomas.addOffender("DOMqueriesByTagName", { diff --git a/test/webroot/js-errors.html b/test/webroot/js-errors.html index fc92bf1d3..d253e8626 100644 --- a/test/webroot/js-errors.html +++ b/test/webroot/js-errors.html @@ -9,4 +9,11 @@ // and this one too, but the execution will never reach this linen window.Foo('test'); +