Skip to content

Commit 041ab27

Browse files
all-laughMichailiK
andauthored
Fixes #514 Require inputing name for playlist make <name> command (#1046)
* Fixes #514 Require inputing name for `playlist make <name>` 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 <[email protected]> * Rid excessive hints Co-authored-by: Michaili K <[email protected]>
1 parent 85aebe8 commit 041ab27

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/jagrosh/jmusicbot/commands/owner/PlaylistCmd.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ public MakelistCmd()
7272
protected void execute(CommandEvent event)
7373
{
7474
String pname = event.getArgs().replaceAll("\\s+", "_");
75-
if(bot.getPlaylistLoader().getPlaylist(pname)==null)
75+
if(pname == null || pname.isEmpty())
76+
{
77+
event.replyError("Please provide a name for the playlist!");
78+
}
79+
else if(bot.getPlaylistLoader().getPlaylist(pname) == null)
7680
{
7781
try
7882
{

0 commit comments

Comments
 (0)