diff --git a/materialcalendarview/src/main/java/io/blackbox_vision/materialcalendarview/view/CalendarView.java b/materialcalendarview/src/main/java/io/blackbox_vision/materialcalendarview/view/CalendarView.java index 8b2fc6e..2e85433 100644 --- a/materialcalendarview/src/main/java/io/blackbox_vision/materialcalendarview/view/CalendarView.java +++ b/materialcalendarview/src/main/java/io/blackbox_vision/materialcalendarview/view/CalendarView.java @@ -269,7 +269,9 @@ protected void onRestoreInstanceState(Parcelable state) { Calendar calendar = getCalDate(lastSelectedDay); update(calendar); markDateAsSelected(lastSelectedDay); - onDateClickListener.onDateClick(lastSelectedDay); + if (onDateClickListener != null) { + onDateClickListener.onDateClick(lastSelectedDay); + } } super.onRestoreInstanceState(state);