Skip to content

Commit

Permalink
Refactor validateParams
Browse files Browse the repository at this point in the history
  • Loading branch information
louietyj committed Nov 7, 2016
1 parent 89bff67 commit fbebb86
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/main/java/seedu/todo/controllers/UpdateController.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,7 @@ private boolean validateParams(boolean isTask, CalendarItem record, String name,
LocalDateTime newDateFrom = (dateFrom == null) ? event.getStartDate() : dateFrom;
LocalDateTime newDateTo = (dateTo == null) ? event.getEndDate() : dateTo;

if (newDateFrom == null || newDateTo == null) {
return false;
}

if (newDateTo.isBefore(newDateFrom)) {
if (newDateFrom == null || newDateTo == null || newDateTo.isBefore(newDateFrom)) {
return false;
}
}
Expand Down

0 comments on commit fbebb86

Please sign in to comment.