seanbrant/pykss — pull request #6 by lananelson (2013-07-01 20:10:35+00:00)
Title: Avoid exception when stylesheet has no style rules.

In some cases JS parser (kss.js) does not work as expected.
I have a stylesheet from Typekit that is included before any other stylesheets.
All it has is `@font-face` at-rules.

These rules will not be retrieved here:
```javascript
ref2 = stylesheet.cssRules;
```
As a result `_ref2` is `null` and exception thrown on the following line
```javascript
for (idx = 0, _len2 = _ref2.length; idx < _len2; idx++) {
```
That results in termination of the outer loop (line 11) and consequently none of the remaining stylesheets that were included after the Typekit stylesheet are parsed.

Since this project probably compiles CoffeeScript from http://github.com/kneath/kss I am not sure whether or not it makes sense to have this bug fixed here. I am going to send a pull request for CoffeeScript as well in the KSS project.