Skip to content

Commit 534df1e

Browse files
committed
Null checks in sounds before pause/resume.
1 parent b5f412e commit 534df1e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

blade-engine/src/com/bladecoder/engine/model/SceneSoundManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,21 @@ public void stopSound(String id) {
8383

8484
public void stop() {
8585
for(LoadedSound s:loadedSounds.values()) {
86-
if(s.playing)
86+
if(s.playing && s.sound != null)
8787
stopSound(s.desc.getId());
8888
}
8989
}
9090

9191
public void resume() {
9292
for(LoadedSound s:loadedSounds.values()) {
93-
if(s.playing)
93+
if(s.playing && s.sound != null)
9494
s.sound.resume();
9595
}
9696
}
9797

9898
public void pause() {
9999
for(LoadedSound s:loadedSounds.values()) {
100-
if(s.playing)
100+
if(s.playing && s.sound != null)
101101
s.sound.pause();
102102
}
103103
}

0 commit comments

Comments
 (0)