diff --git a/src/main/java/gbot/TaskList.java b/src/main/java/gbot/TaskList.java index 1785467b57..af361e2e7d 100644 --- a/src/main/java/gbot/TaskList.java +++ b/src/main/java/gbot/TaskList.java @@ -197,10 +197,11 @@ public String deleteAllTasks() { * @param keyword The keyword given by user. */ public String find(String keyword) { + assert keyword != null; ArrayList matchList = new ArrayList<>(); for (int i = 0; i < taskCount; i++) { Task curr = list.get(i); - if (curr.getDescription().toLowerCase().contains(keyword)) { + if (curr.getDescription().toLowerCase().contains(keyword.strip())) { matchList.add(curr); } }