Skip to content

Commit

Permalink
Merge pull request prolificinteractive#578 from codeskraps/master
Browse files Browse the repository at this point in the history
MaterialCalendarView selectRange NullPointerException
  • Loading branch information
quentin41500 authored May 16, 2017
2 parents cc2c55d + d13b73f commit 60a8cdb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,9 @@ protected void onDateClicked(@NonNull CalendarDay date, boolean nowSelected) {
*/
public void selectRange(final CalendarDay firstDay, final CalendarDay lastDay) {
clearSelection();
if (firstDay.isAfter(lastDay)) {
if (firstDay == null || lastDay == null) {
return;
} else if (firstDay.isAfter(lastDay)) {
dispatchOnRangeSelected(lastDay, firstDay);
} else {
dispatchOnRangeSelected(firstDay, lastDay);
Expand Down

0 comments on commit 60a8cdb

Please sign in to comment.