From 3a064d67967f1409edf18ae999db110a51d51884 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 29 Sep 2021 19:21:42 +0200 Subject: [PATCH] a IDBRequest when opening the database does not have a source --- src/matrix/storage/idb/error.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/matrix/storage/idb/error.ts b/src/matrix/storage/idb/error.ts index fb602168..abfbe415 100644 --- a/src/matrix/storage/idb/error.ts +++ b/src/matrix/storage/idb/error.ts @@ -33,10 +33,10 @@ export class IDBError extends StorageError { storeName: string; databaseName: string; - constructor(message: string, sourceOrCursor: IDBIndex | IDBCursor | IDBObjectStore, cause: DOMException | null = null) { - const source = "source" in sourceOrCursor ? sourceOrCursor.source : sourceOrCursor; - const storeName = _sourceName(source); - const databaseName = _sourceDatabase(source); + constructor(message: string, sourceOrCursor: IDBIndex | IDBCursor | IDBObjectStore | null, cause: DOMException | null = null) { + const source = (sourceOrCursor && "source" in sourceOrCursor) ? sourceOrCursor.source : sourceOrCursor; + const storeName = source ? _sourceName(source) : ""; + const databaseName = source ? _sourceDatabase(source) : ""; let fullMessage = `${message} on ${databaseName}.${storeName}`; if (cause) { fullMessage += ": ";