aboutsummaryrefslogtreecommitdiff
path: root/lib/wallet/chromeBadge.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-09-26 18:00:21 +0200
committerFlorian Dold <florian.dold@gmail.com>2016-09-26 18:00:26 +0200
commit211e8c25d52644552cb37531cdb637f4f12c8782 (patch)
tree1ba56cb19a88b5dc9cbc4950b4814d84128ab3db /lib/wallet/chromeBadge.ts
parentc89c90b7fa69b030c82f8cc73a29f89987016250 (diff)
downloadwallet-core-211e8c25d52644552cb37531cdb637f4f12c8782.tar.xz
fix bug in retrying logic for reserve status
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
+}