Permalink
Browse files

Do not call split on selectorText if it is undefined so that it doesn…

…'t throw an error
  • Loading branch information...
1 parent c5ee555 commit 6410f12e4d3dd460ac200a915dfc61438e6e62a2 @luccastera committed Dec 20, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/jsdom/browser/index.js
View
2 lib/jsdom/browser/index.js
@@ -249,7 +249,7 @@ exports.createWindow = function(dom, options) {
forEach.call(node.ownerDocument.styleSheets, function (sheet) {
forEach.call(sheet.cssRules, function (ruleSet) {
- selectors = ruleSet.selectorText.split(/\s*,\s*/);
+ selectors = ruleSet.selectorText ? ruleSet.selectorText.split(/\s*,\s*/) : [];
matched = false;
selectors.forEach(function (selectorText) {
if (!matched && matchesDontThrow(node, selectorText)) {

0 comments on commit 6410f12

Please sign in to comment.