Prevent error if queue command is used while not in a channel.

This commit is contained in:
Nekojimi 2024-04-04 12:59:37 +01:00
parent 758f6a0d48
commit 143f5dacda
1 changed files with 3 additions and 1 deletions

View File

@ -36,7 +36,9 @@ public class QueueCommand extends Command
String message = ">>> "; String message = ">>> ";
int i = 1; int i = 1;
final Track currentTrack = bot.getMusicHandler().getCurrentTrack(); Track currentTrack = null;
if (bot.getMusicHandler() != null)
currentTrack = bot.getMusicHandler().getCurrentTrack();
if (currentTrack != null) if (currentTrack != null)
message += ":notes: **Now playing: " + currentTrack + "**\n"; message += ":notes: **Now playing: " + currentTrack + "**\n";
else else