From 2e03357de02c6e64b9ac3a14f6f63b7be0ad335d Mon Sep 17 00:00:00 2001 From: Noble Wave Date: Tue, 24 Dec 2024 23:14:57 +0530 Subject: [PATCH] The reject function is being used to propagate an error, but this could lead to issues if the reject function is called multiple times. --- projects/ngx-indexed-db/src/utils/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/ngx-indexed-db/src/utils/index.ts b/projects/ngx-indexed-db/src/utils/index.ts index 45e5594..6ddbafe 100644 --- a/projects/ngx-indexed-db/src/utils/index.ts +++ b/projects/ngx-indexed-db/src/utils/index.ts @@ -13,6 +13,7 @@ export function validateStoreName(db: IDBDatabase, storeName: string): boolean { export function validateBeforeTransaction(db: IDBDatabase, storeName: string, reject: (message: string) => void): void { if (!db) { reject('You need to use the openDatabase function to create a database before you query it!'); + return; // Stop further execution } if (!validateStoreName(db, storeName)) { reject(`objectStore does not exists: ${storeName}`);