aboutsummaryrefslogtreecommitdiff
path: root/extension
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2015-12-18 13:46:40 +0100
committerFlorian Dold <florian.dold@gmail.com>2015-12-18 13:46:40 +0100
commitc03100cc0d79f3b8504c6f41c32edcfdf5d17e57 (patch)
tree6b855037cebd261c81c69681d6a9eaedc35cb528 /extension
parentbc05121da2178cb1347c6564fb582b7cf82d9cd1 (diff)
downloadwallet-core-c03100cc0d79f3b8504c6f41c32edcfdf5d17e57.tar.xz
error message
Diffstat (limited to 'extension')
-rw-r--r--extension/background/wallet.js3
-rw-r--r--extension/background/wallet.ts3
2 files changed, 6 insertions, 0 deletions
diff --git a/extension/background/wallet.js b/extension/background/wallet.js
index 6e4438a0d..8aec5ecb1 100644
--- a/extension/background/wallet.js
+++ b/extension/background/wallet.js
@@ -81,6 +81,9 @@ function getPossibleMintCoins(db, paymentAmount, depositFeeLimit, allowedMints)
.get(info.master_pub);
req_mints.onsuccess = (e) => {
let mint = req_mints.result;
+ if (!mint) {
+ throw Error("no matching mint in index");
+ }
let req_coins = tx.objectStore("coins")
.index("mintBaseUrl")
.openCursor(IDBKeyRange.only(mint.baseUrl));
diff --git a/extension/background/wallet.ts b/extension/background/wallet.ts
index 7fee5490e..ee406d2ed 100644
--- a/extension/background/wallet.ts
+++ b/extension/background/wallet.ts
@@ -157,6 +157,9 @@ function getPossibleMintCoins(db: IDBDatabase,
.get(info.master_pub);
req_mints.onsuccess = (e) => {
let mint: Db.Mint = req_mints.result;
+ if (!mint) {
+ throw Error("no matching mint in index");
+ }
let req_coins = tx.objectStore("coins")
.index("mintBaseUrl")
.openCursor(IDBKeyRange.only(mint.baseUrl));