Fixed rules.length null error

Some Chrome Extension add style sheets to the page and the rules can't
be access or return null.