File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ T | 0 | run
12T | 0 | java
Original file line number Diff line number Diff line change @@ -70,9 +70,9 @@ public String reportTask(Task t, TaskList task) {
7070 + "\n "
7171 + "You now have "
7272 + count
73- + "task in the list.\n " ;
73+ + " task in the list.\n " ;
7474 assert count >= 0 : "Size is less than 0" ;
75- return printMessage ( output ) ;
75+ return output ;
7676 }
7777
7878 /**
@@ -97,12 +97,15 @@ public Command getUserInputType(String userInput) throws DukeException {
9797 * reported on the finded task
9898 */
9999 public String reportFindedTask (List <Task > task ) {
100+ if (task .isEmpty ()) {
101+ return "There is no matching tasks in your list" ;
102+ }
100103 String ans = "Here are the matching tasks in your list\n " ;
101104 for (int i = 0 ; i < task .size (); i ++) {
102105 int index = i + 1 ;
103106 ans += index + "." + task .get (i ).toString () + "\n " ;
104107 }
105- return printMessage ( ans ) ;
108+ return ans ;
106109 }
107110
108111 /**
You can’t perform that action at this time.
0 commit comments