diff options
author | Teemu Pöntelin <teemu@vaadin.com> | 2014-12-15 20:10:53 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-12-16 09:31:12 +0000 |
commit | 02d33ca7aea74f31319ce3920a7c67ac6f59571b (patch) | |
tree | 07e8eed1f7bf47c6685ae8f15dc8d9f86cf366a5 /server | |
parent | 1b211745b02fbff5d4084f5ccada07cff8c09c85 (diff) | |
download | vaadin-framework-02d33ca7aea74f31319ce3920a7c67ac6f59571b.tar.gz vaadin-framework-02d33ca7aea74f31319ce3920a7c67ac6f59571b.zip |
Fix NPE in DateField range handling (#15342)
The NPE was introduced by 206055708b0a8e1c17a8c63d482a5e202d3ebf6d.
Change-Id: I34401e108f7c02ee2f0aab581a78b9ab468b2b46
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/ui/DateField.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/src/com/vaadin/ui/DateField.java b/server/src/com/vaadin/ui/DateField.java index d5700c4b65..3d683f4902 100644 --- a/server/src/com/vaadin/ui/DateField.java +++ b/server/src/com/vaadin/ui/DateField.java @@ -319,7 +319,8 @@ public class DateField extends AbstractField<Date> implements // Create a defensive copy against issues when using java.sql.Date (and // also against mutable Date). - getState().rangeStart = new Date(startDate.getTime()); + getState().rangeStart = startDate != null ? new Date( + startDate.getTime()) : null; updateRangeValidator(); } @@ -439,7 +440,8 @@ public class DateField extends AbstractField<Date> implements // Create a defensive copy against issues when using java.sql.Date (and // also against mutable Date). - getState().rangeEnd = new Date(endDate.getTime()); + getState().rangeEnd = endDate != null ? new Date(endDate.getTime()) + : null; updateRangeValidator(); } |