When closing database, be resilient to null db
This commit is contained in:
parent
5c2514ecb8
commit
6ef0eb7284
1 changed files with 4 additions and 0 deletions
|
@ -749,6 +749,10 @@ async function initialize({ configDir, key, messages }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function close() {
|
async function close() {
|
||||||
|
if (!db) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const dbRef = db;
|
const dbRef = db;
|
||||||
db = null;
|
db = null;
|
||||||
await dbRef.close();
|
await dbRef.close();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue