Skip to content

Commit 6be2d8d

Browse files
committed
Audio : fixes problem about null sound path
1 parent 273e36c commit 6be2d8d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/bms/player/beatoraja/audio/AbstractAudioDriver.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ protected float getVolume() {
9292
}
9393

9494
public void play(String p, boolean loop) {
95+
if(p == null || p.length() == 0) {
96+
return;
97+
}
9598
T sound = soundmap.get(p);
9699
if (!soundmap.containsKey(p)) {
97100
try {
@@ -108,13 +111,19 @@ public void play(String p, boolean loop) {
108111
}
109112

110113
public void stop(String p) {
114+
if(p == null || p.length() == 0) {
115+
return;
116+
}
111117
T sound = soundmap.get(p);
112118
if (sound != null) {
113119
stop(sound);
114120
}
115121
}
116122

117123
public void dispose(String p) {
124+
if(p == null || p.length() == 0) {
125+
return;
126+
}
118127
T sound = soundmap.get(p);
119128
if (sound != null) {
120129
soundmap.remove(p);

0 commit comments

Comments
 (0)