Permalink
Browse files

Avoid exception when selectorText not defined

  • Loading branch information...
1 parent c5ee555 commit 21859d5c571f372896fe96a93e15c7e1cc11220a @haraldrudell committed Dec 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 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 = typeof ruleSet.selectorText == 'string' ? ruleSet.selectorText.split(/\s*,\s*/) : [];
matched = false;
selectors.forEach(function (selectorText) {
if (!matched && matchesDontThrow(node, selectorText)) {

0 comments on commit 21859d5

Please sign in to comment.