From 041ab27b9416a69c1e3a761387d50a34870606e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xiao=20Quan=20=E5=85=A8=E7=AC=91?= <58939349+all-laugh@users.noreply.github.com> Date: Wed, 6 Apr 2022 12:44:52 -0400 Subject: [PATCH] Fixes #514 Require inputing name for `playlist make ` command (#1046) * Fixes #514 Require inputing name for `playlist make ` command playlist make command without a name will now not make an empty playlist without a playlist name. * Update src/main/java/com/jagrosh/jmusicbot/commands/owner/PlaylistCmd.java Co-authored-by: Michaili K * Rid excessive hints Co-authored-by: Michaili K --- .../com/jagrosh/jmusicbot/commands/owner/PlaylistCmd.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/jagrosh/jmusicbot/commands/owner/PlaylistCmd.java b/src/main/java/com/jagrosh/jmusicbot/commands/owner/PlaylistCmd.java index 0caf39756..83064d5c4 100644 --- a/src/main/java/com/jagrosh/jmusicbot/commands/owner/PlaylistCmd.java +++ b/src/main/java/com/jagrosh/jmusicbot/commands/owner/PlaylistCmd.java @@ -72,7 +72,11 @@ public MakelistCmd() protected void execute(CommandEvent event) { String pname = event.getArgs().replaceAll("\\s+", "_"); - if(bot.getPlaylistLoader().getPlaylist(pname)==null) + if(pname == null || pname.isEmpty()) + { + event.replyError("Please provide a name for the playlist!"); + } + else if(bot.getPlaylistLoader().getPlaylist(pname) == null) { try {