Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 5f2d9b6

Browse files
committed
Null check stylesheet href
As commented Fixes element-hq/element-web#6489
1 parent 1adb82b commit 5f2d9b6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Tinter.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,9 @@ class Tinter {
326326
// Vector Green as any other colour.
327327
// --matthew
328328

329-
if (ss.href && !ss.href.match(new RegExp('/theme-' + this.theme + '.css$'))) continue;
329+
// stylesheets we don't have permission to access (eg. ones from extensions) have a null
330+
// href and will throw exceptions if we try to access their rules.
331+
if (!ss.href || !ss.href.match(new RegExp('/theme-' + this.theme + '.css$'))) continue;
330332
if (ss.disabled) continue;
331333
if (!ss.cssRules) continue;
332334

0 commit comments

Comments
 (0)