Skip to content

Commit

Permalink
Fixes #514 Require inputing name for playlist make <name> command (#…
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
all-laugh and MichailiK authored Apr 6, 2022
1 parent 85aebe8 commit 041ab27
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 041ab27

Please sign in to comment.