Skip to content

Commit db60f78

Browse files
authored
Update ALAudioRenderer: enhanced log message
1 parent 874f86d commit db60f78

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,12 @@ public void pauseSource(AudioSource src) {
14471447
return;
14481448
}
14491449

1450+
AudioData audioData = src.getAudioData();
1451+
if (audioData == null) {
1452+
logger.log(Level.WARNING, "pauseSource called on source with null AudioData: {0}", src);
1453+
return;
1454+
}
1455+
14501456
if (src.getStatus() == Status.Playing) {
14511457
assert src.getChannel() != -1;
14521458

@@ -1471,6 +1477,12 @@ public void stopSource(AudioSource src) {
14711477
return;
14721478
}
14731479

1480+
AudioData audioData = src.getAudioData();
1481+
if (audioData == null) {
1482+
logger.log(Level.WARNING, "stopSource called on source with null AudioData: {0}", src);
1483+
return;
1484+
}
1485+
14741486
if (src.getStatus() != Status.Stopped) {
14751487
int channel = src.getChannel();
14761488
assert channel != -1; // if it's not stopped, must have id

0 commit comments

Comments
 (0)