Skip to content

Commit

Permalink
Add message when list called on empty tasklist
Browse files Browse the repository at this point in the history
  • Loading branch information
billyhoce committed Feb 21, 2024
1 parent a18dd0d commit 0f5a065
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/meanduke/commands/ListCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public ListCommand(TaskList taskList) {

@Override
public String execute() {
return this.taskList.toString();
String listString = this.taskList.toString();
if (listString.isEmpty()) {
return "Dude... your task list is empty. Stop procrastinating and add some tasks meow...";
}
return listString;
}
}

0 comments on commit 0f5a065

Please sign in to comment.