aboutsummaryrefslogtreecommitdiff
path: root/lib/wallet/chromeBadge.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/wallet/chromeBadge.ts')
-rw-r--r--lib/wallet/chromeBadge.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/wallet/chromeBadge.ts b/lib/wallet/chromeBadge.ts
index 6586f7e6e..df12fba83 100644
--- a/lib/wallet/chromeBadge.ts
+++ b/lib/wallet/chromeBadge.ts
@@ -86,6 +86,9 @@ export class ChromeBadge implements Badge {
constructor(window?: Window) {
// Allow injecting another window for testing
let bg = window || chrome.extension.getBackgroundPage();
+ if (!bg) {
+ throw Error("no window available");
+ }
this.canvas = bg.document.createElement("canvas");
// Note: changing the width here means changing the font
// size in draw() as well!
@@ -221,4 +224,4 @@ export class ChromeBadge implements Badge {
stopBusy() {
this.isBusy = false;
}
-} \ No newline at end of file
+}