I came into some NullPointerException using calendar Add-on (7.2.1)
After some digging i found out that Calendar does not like so much having some date with null value, especially start-date or end-date… ok quite normal
Stack trace :
java.lang.NullPointerException
at java.util.Calendar.setTime(Calendar.java:1106)
at java.text.SimpleDateFormat.format(SimpleDateFormat.java:955)
at java.text.SimpleDateFormat.format(SimpleDateFormat.java:948)
at java.text.DateFormat.format(DateFormat.java:336)
at com.vaadin.ui.Calendar.setupCalendarEvents(Calendar.java:435)
at com.vaadin.ui.Calendar.beforeClientResponse(Calendar.java:307)
In case of using some DBContainer (JPAContainer, SQLContainer, …), it’s not so easy to control and correct values.
Shouldn’t it be a good idea to make some checks and make some simple logic : for instance if no end-date is set, put same as start-date. No start-date then skip…
Or may be there is some trick to implement those rules by myself ? Any suggestion ?