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:
parent
a6dfd98717
commit
744e720c3b
1 changed files with 4 additions and 0 deletions
|
|
@ -55,6 +55,10 @@ function init (appState) {
|
|||
}
|
||||
|
||||
function play (name) {
|
||||
if (state == null) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!state.saved.prefs.soundNotifications) {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue