Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
1.4-RC2
-
None
Description
We use DateTimeField to set a date of bean object and want to allow user to null that field by removing the date. Separate checkbox/button for setting the date to null would be unintuitive in this. However when the user does that, NPE is thrown at DateTimeField#setTime(Date date):239, because if the parameter date is null (as in this case it is), the flow of the method is as follows:
231: set this.date to null
232: set default model object to null
239: call .set() on this.date which is now null - throws NPE
Most simple fix for this would most likely be to insert if(date == null)
{ return; }to line 233.