Skip to content

Commit

Permalink
null callback before calling
Browse files Browse the repository at this point in the history
  • Loading branch information
bridiver committed May 2, 2017
1 parent 3929717 commit 88ea825
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ const logSaveAppStateError = (e) => {
}

const saveAppState = (forceSave = false) => {
if (!sessionStateStoreCompleteCallback) {
return
}

// If we're shutting down early and can't access the state, it's better
// to not try to save anything at all and just quit.
if (shuttingDown && !AppStore.getState()) {
Expand Down Expand Up @@ -151,8 +155,9 @@ const saveAppState = (forceSave = false) => {
app.quit()
}
} else {
sessionStateStoreCompleteCallback()
const cb = sessionStateStoreCompleteCallback
sessionStateStoreCompleteCallback = null
cb()
}
}
})
Expand Down

0 comments on commit 88ea825

Please sign in to comment.