When closing database, be resilient to null db

This commit is contained in:
Scott Nonnenberg 2019-03-28 10:51:19 -07:00
parent 5c2514ecb8
commit 6ef0eb7284

View file

@ -749,6 +749,10 @@ async function initialize({ configDir, key, messages }) {
}
async function close() {
if (!db) {
return;
}
const dbRef = db;
db = null;
await dbRef.close();