Skip to content

Commit

Permalink
Avoid exception when selectorText not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldrudell committed Dec 26, 2012
1 parent c5ee555 commit 21859d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/jsdom/browser/index.js
Expand Up @@ -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 = typeof ruleSet.selectorText == 'string' ? ruleSet.selectorText.split(/\s*,\s*/) : [];
matched = false;
selectors.forEach(function (selectorText) {
if (!matched && matchesDontThrow(node, selectorText)) {
Expand Down

0 comments on commit 21859d5

Please sign in to comment.