From 91024007aaa576d2e029c195641a8b45a269037f Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 11 Apr 2018 18:20:40 +0100 Subject: [PATCH] Null check stylesheet href As commented Fixes https://github.com/vector-im/riot-web/issues/6489 --- src/Tinter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Tinter.js b/src/Tinter.js index 7667e6d912..75a65412a4 100644 --- a/src/Tinter.js +++ b/src/Tinter.js @@ -326,7 +326,9 @@ class Tinter { // Vector Green as any other colour. // --matthew - if (ss.href && !ss.href.match(new RegExp('/theme-' + this.theme + '.css$'))) continue; + // stylesheets we don't have permission to access (eg. ones from extensions) have a null + // href and will throw exceptions if we try to access their rules. + if (!ss.href || !ss.href.match(new RegExp('/theme-' + this.theme + '.css$'))) continue; if (ss.disabled) continue; if (!ss.cssRules) continue;