Ignore play() when called before init()

If an error occurs during startup, then it's possible that we'll try to call sound.play('ERROR') in the error handler, which will throw an exception. Instead, just don't play sounds in this case.
This commit is contained in:
Feross Aboukhadijeh
2019-09-05 23:59:32 -07:00
parent a6dfd98717
commit 744e720c3b

View File

@@ -55,6 +55,10 @@ function init (appState) {
}
function play (name) {
if (state == null) {
return
}
if (!state.saved.prefs.soundNotifications) {
return
}