diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-09-26 18:00:21 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-09-26 18:00:26 +0200 |
commit | 211e8c25d52644552cb37531cdb637f4f12c8782 (patch) | |
tree | 1ba56cb19a88b5dc9cbc4950b4814d84128ab3db /lib/wallet/chromeBadge.ts | |
parent | c89c90b7fa69b030c82f8cc73a29f89987016250 (diff) | |
download | wallet-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.ts | 5 |
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 +} |