From 51c470a9bc13adf9bbd644167a48f031190dfde4 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 2 Apr 2018 10:14:40 -0400 Subject: [PATCH] Fixed a NumberFormatException bug --- .../netneutrality/command/music/VolumeCommand.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/netneutrality/command/music/VolumeCommand.java b/src/main/java/netneutrality/command/music/VolumeCommand.java index 0e9a460..59d212d 100644 --- a/src/main/java/netneutrality/command/music/VolumeCommand.java +++ b/src/main/java/netneutrality/command/music/VolumeCommand.java @@ -54,9 +54,14 @@ public class VolumeCommand extends AbstractCommand { if (player.isConnected()) { if (player.isConnectedTo(vChannel)) { - int volume; - volume = Integer.parseInt(args.split(" ")[0]); - player.setVolume(volume); + + try { + int volume = Integer.parseInt(args.split(" ")[0]); + player.setVolume(volume); + } catch (NumberFormatException e) { + e.printStackTrace(); + } + } else event.getTextChannel().sendMessage("Not in your voice channel").queue(); } else