From 0f5a065e6bb9788c4edd87051a197290b7d52847 Mon Sep 17 00:00:00 2001 From: billyhoce Date: Wed, 21 Feb 2024 21:09:56 +0800 Subject: [PATCH] Add message when list called on empty tasklist --- src/main/java/meanduke/commands/ListCommand.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/meanduke/commands/ListCommand.java b/src/main/java/meanduke/commands/ListCommand.java index 826cde98ed..69c17b0524 100644 --- a/src/main/java/meanduke/commands/ListCommand.java +++ b/src/main/java/meanduke/commands/ListCommand.java @@ -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; } }