getComputedStyle crashes on some pages #548

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+1 −1
Diff settings

Always

Just for now

@@ -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)) {