Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make sure the css rule has selectorText to prevent parsing exception.…

… hit this on @media rules which do not have selector text. afaik this means media queries will not be inlined. however everything else is.
  • Loading branch information...
commit efaa7e0f6fae83727d2cce780d032cbcd7a6b4e6 1 parent 91c2407
@cbumgard cbumgard authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/utils.js
View
10 lib/utils.js
@@ -56,11 +56,13 @@ exports.parseCSS = function (css) {
, ret = []
for (var i = 0, l = rules.length; i < l; i++) {
- var rule = rules[i]
- , selectors = exports.extract(rule.selectorText)
+ if (rules[i].selectorText) { // media queries don't have selectorText
+ var rule = rules[i]
+ , selectors = exports.extract(rule.selectorText)
- for (var ii = 0, ll = selectors.length; ii < ll; ii++) {
- ret.push([selectors[ii], rule.style]);
+ for (var ii = 0, ll = selectors.length; ii < ll; ii++) {
+ ret.push([selectors[ii], rule.style]);
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.