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() {
|
||||
if (!db) {
|
||||
return;
|
||||
}
|
||||
|
||||
const dbRef = db;
|
||||
db = null;
|
||||
await dbRef.close();
|
||||
|
|
Loading…
Reference in a new issue