When closing database, be resilient to null db
This commit is contained in:
@@ -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();
|
||||||
|
Reference in New Issue
Block a user