Skip to content

Commit

Permalink
Guard against null due dates
Browse files Browse the repository at this point in the history
  • Loading branch information
louietyj committed Nov 5, 2016
1 parent 3aa7cc5 commit 143a96f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/seedu/todo/models/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ public static Predicate<Task> predByName(String name) {
}

public static Predicate<Task> predBeforeDueDate(LocalDateTime date) {
return (Task task) -> task.getDueDate().isBefore(date);
return (Task task) -> task.getDueDate() != null && task.getDueDate().isBefore(date);
}

public static Predicate<Task> predAfterDueDate(LocalDateTime date) {
return (Task task) -> task.getDueDate().isAfter(date);
return (Task task) -> task.getDueDate() != null && task.getDueDate().isAfter(date);
}

public static Predicate<Task> predCompleted(boolean completed) {
Expand Down

0 comments on commit 143a96f

Please sign in to comment.