Properly clear presence message when the queue runs dry.

This commit is contained in:
Nekojimi 2022-05-18 20:57:51 +01:00
parent 1fa14ba168
commit 6c3d66069c
1 changed files with 2 additions and 2 deletions

View File

@ -106,11 +106,11 @@ public class MusicHandler implements AudioSendHandler, Closeable, Consumer<Song>
currentSong = null;
}
currentSong = songQueue.poll();
if (nowPlayingConsumer != null)
nowPlayingConsumer.accept(currentSong);
if (currentSong == null)
return false;
System.out.println("Playing song " + currentSong.getLocation().getAbsolutePath());
if (nowPlayingConsumer != null)
nowPlayingConsumer.accept(currentSong);
arrayErr = false;
in = AudioSystem.getAudioInputStream(currentSong.getLocation());
AudioFormat decodedFormat = AudioSendHandler.INPUT_FORMAT;