Skip to content

Commit f062a02

Browse files
committed
minor bug fixed :trollface:
1 parent 1532eb9 commit f062a02

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

data/duke.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
T | 0 | run
12
T | 0 | java

src/main/java/duke/ui/Ui.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff 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
/**

0 commit comments

Comments
 (0)