fix: NPE on music skip

This commit is contained in:
ChomeNS
2025-05-06 20:32:09 +07:00
parent 0e8bd4404b
commit d9608f25cb
2 changed files with 4 additions and 2 deletions

View File

@@ -365,12 +365,14 @@ public class MusicCommand extends Command implements Listener {
final MusicPlayerPlugin music = bot.music;
if (music.currentSong == null) throw new CommandException(Component.translatable("commands.music.error.not_playing"));
final String name = music.currentSong.name;
music.skip();
return Component.translatable(
"commands.music.skip",
bot.colorPalette.defaultColor,
Component.text(music.currentSong.name, bot.colorPalette.secondary)
Component.text(name, bot.colorPalette.secondary)
);
}