Skip to content

Commit

Permalink
throw error for dbmeta null
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjwalguptaofficial committed Sep 19, 2023
1 parent 4b46934 commit 2f01f0b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/connection_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ export class ConnectionHelper {
if (!isConnectionApi && this.isDbIdle_ && this.isConOpened_) {
this.openDb_();
}
else {
clearTimeout(this.inactivityTimer_);
}
clearTimeout(this.inactivityTimer_);
}
this.prcoessExecutionOfQry_(request);
}).catch(reject);
Expand Down
3 changes: 3 additions & 0 deletions src/worker/query_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ export class QueryManager {
}

const dbMeta = dataBase ? new DbMeta(dataBase) : this.db;
if (dbMeta == null) {
throw new Error(`dbMeta is null`);
}
this.util = new IDBUtil();

return promise<boolean>((res, rej) => {
Expand Down
3 changes: 3 additions & 0 deletions src/worker/utils/db_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { DbMeta } from "@worker/model";
import { IDataBase, ITable } from "@/common";

export const userDbSchema = (db: DbMeta) => {
if (db == null) {
throw new Error(`userDbSchema db is null`);
}
const database = {
name: db.name,
version: db.version,
Expand Down

0 comments on commit 2f01f0b

Please sign in to comment.