Skip to content
Snippets Groups Projects
Commit 872e8e30 authored by srosse's avatar srosse
Browse files

OO-1645: possible NPE if the date field is empty

parent cc60c72f
No related branches found
No related tags found
No related merge requests found
...@@ -217,7 +217,7 @@ public class CalendarEntryForm extends FormBasicController { ...@@ -217,7 +217,7 @@ public class CalendarEntryForm extends FormBasicController {
if (end.getDate() == null) { if (end.getDate() == null) {
end.setErrorKey("cal.form.error.date", null); end.setErrorKey("cal.form.error.date", null);
allOk &= false; allOk &= false;
} else if (end.getDate().before(begin.getDate())) { } else if (begin.getDate() != null && end.getDate().before(begin.getDate())) {
end.setErrorKey("cal.form.error.endbeforebegin", null); end.setErrorKey("cal.form.error.endbeforebegin", null);
allOk &= false; allOk &= false;
} }
...@@ -229,7 +229,8 @@ public class CalendarEntryForm extends FormBasicController { ...@@ -229,7 +229,8 @@ public class CalendarEntryForm extends FormBasicController {
allOk &= false; allOk &= false;
} }
if (hasEnd && recurrenceEnd.getDate().before(begin.getDate())) { if (hasEnd && recurrenceEnd.getDate() != null && begin.getDate() != null
&& recurrenceEnd.getDate().before(begin.getDate())) {
recurrenceEnd.setErrorKey("cal.form.error.endbeforebegin", null); recurrenceEnd.setErrorKey("cal.form.error.endbeforebegin", null);
allOk &= false; allOk &= false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment