Skip to content

Commit

Permalink
When closing database, be resilient to null db
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Mar 29, 2019
1 parent 5c2514e commit 6ef0eb7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,10 @@ async function initialize({ configDir, key, messages }) {
}

async function close() {
if (!db) {
return;
}

const dbRef = db;
db = null;
await dbRef.close();
Expand Down

0 comments on commit 6ef0eb7

Please sign in to comment.