From bb0051f24f049d3102f4f60c2f1cd420bef6024a Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 24 Jan 2016 11:46:25 +0000 Subject: [PATCH] fix another NPE; apparently some stylesheets don't have href attributes (wtf?) --- src/Tinter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Tinter.js b/src/Tinter.js index 909cbcd33d..f08bdd7297 100644 --- a/src/Tinter.js +++ b/src/Tinter.js @@ -82,7 +82,9 @@ function calcCssFixups() { // privacybadger inserting its own stylesheet in there with a // resource:// URI or something which results in a XSS error. // 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; for (var j = 0; j < ss.cssRules.length; j++) { var rule = ss.cssRules[j];