Skip to content

Commit 041ab27

Browse files
all-laughMichailiK
andauthored
Fixes jagrosh#514 Require inputing name for playlist make <name> command (jagrosh#1046)
* Fixes jagrosh#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 <mysteriouscursor+git@protonmail.com> * Rid excessive hints Co-authored-by: Michaili K <mysteriouscursor+git@protonmail.com>
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

+5-1
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)