Hi there,
observerd in version 11.0.0:
When instancing a CalendarPanel using the parameter-less constructor
CalendarPanel calendarPanel = new CalendarPanel();
I get a NullPointerException:
java.lang.NullPointerException: null
at com.github.lgooddatepicker.components.CalendarPanel.<init>(CalendarPanel.java:253)
at com.github.lgooddatepicker.components.CalendarPanel.<init>(CalendarPanel.java:211)
...
It turns out that in the line in which the exception occurs...
displayedYearMonth = YearMonth.now(datePickerSettings.getClock());
...the datePickerSettings parameter is null (obviously, when looking at the calling site in line 211).
It's only in line 294 of the constructor that the setSettings(datePickerSettings) function gets called, which ensures that a default settings object is created in case the passed datePickerSettings are null.
I currently don't have the possibility to fork the project and to work on this issue myself, but perhaps a simple solution would be to move the setSettings(datePickerSettings) call right to the start of the constructor and to replace displayedYearMonth = YearMonth.now(datePickerSettings.getClock()); with displayedYearMonth = YearMonth.now(settings.getClock());?
Cheers -- Torsten
Hi there,
observerd in version 11.0.0:
When instancing a CalendarPanel using the parameter-less constructor
CalendarPanel calendarPanel = new CalendarPanel();I get a NullPointerException:
It turns out that in the line in which the exception occurs...
displayedYearMonth = YearMonth.now(datePickerSettings.getClock());...the datePickerSettings parameter is null (obviously, when looking at the calling site in line 211).
It's only in line 294 of the constructor that the
setSettings(datePickerSettings)function gets called, which ensures that a default settings object is created in case the passed datePickerSettings are null.I currently don't have the possibility to fork the project and to work on this issue myself, but perhaps a simple solution would be to move the
setSettings(datePickerSettings)call right to the start of the constructor and to replacedisplayedYearMonth = YearMonth.now(datePickerSettings.getClock());withdisplayedYearMonth = YearMonth.now(settings.getClock());?Cheers -- Torsten