error message

This commit is contained in:
Florian Dold 2015-12-18 13:46:40 +01:00
parent bc05121da2
commit c03100cc0d
2 changed files with 6 additions and 0 deletions

View File

@ -81,6 +81,9 @@ function getPossibleMintCoins(db, paymentAmount, depositFeeLimit, allowedMints)
.get(info.master_pub); .get(info.master_pub);
req_mints.onsuccess = (e) => { req_mints.onsuccess = (e) => {
let mint = req_mints.result; let mint = req_mints.result;
if (!mint) {
throw Error("no matching mint in index");
}
let req_coins = tx.objectStore("coins") let req_coins = tx.objectStore("coins")
.index("mintBaseUrl") .index("mintBaseUrl")
.openCursor(IDBKeyRange.only(mint.baseUrl)); .openCursor(IDBKeyRange.only(mint.baseUrl));

View File

@ -157,6 +157,9 @@ function getPossibleMintCoins(db: IDBDatabase,
.get(info.master_pub); .get(info.master_pub);
req_mints.onsuccess = (e) => { req_mints.onsuccess = (e) => {
let mint: Db.Mint = req_mints.result; let mint: Db.Mint = req_mints.result;
if (!mint) {
throw Error("no matching mint in index");
}
let req_coins = tx.objectStore("coins") let req_coins = tx.objectStore("coins")
.index("mintBaseUrl") .index("mintBaseUrl")
.openCursor(IDBKeyRange.only(mint.baseUrl)); .openCursor(IDBKeyRange.only(mint.baseUrl));