Null check stylesheet href

As commented

Fixes https://github.com/vector-im/riot-web/issues/6489
pull/21833/head
David Baker 2018-04-11 18:20:40 +01:00
parent 300e6877f5
commit 91024007aa
1 changed files with 3 additions and 1 deletions

View File

@ -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;