fix another NPE; apparently some stylesheets don't have href attributes (wtf?)

This commit is contained in:
Matthew Hodgson 2016-01-24 11:46:25 +00:00
parent 3da76192a1
commit bb0051f24f

View file

@ -82,7 +82,9 @@ function calcCssFixups() {
// privacybadger inserting its own stylesheet in there with a // privacybadger inserting its own stylesheet in there with a
// resource:// URI or something which results in a XSS error. // resource:// URI or something which results in a XSS error.
// See also #vector:matrix.org/$145357669685386ebCfr:matrix.org // See also #vector:matrix.org/$145357669685386ebCfr:matrix.org
if (!ss.href.endsWith("/bundle.css")) continue; // ...except some browsers apparently return stylesheets without
// hrefs, which we have no choice but ignore right now
if (ss.href && !ss.href.endsWith("/bundle.css")) continue;
if (!ss.cssRules) continue; if (!ss.cssRules) continue;
for (var j = 0; j < ss.cssRules.length; j++) { for (var j = 0; j < ss.cssRules.length; j++) {
var rule = ss.cssRules[j]; var rule = ss.cssRules[j];