diff options
author | Artur Signell <artur@vaadin.com> | 2013-11-04 19:59:50 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2013-11-04 20:00:02 +0200 |
commit | c4aff7781269427bd4beccf7fc7d04b8760359b5 (patch) | |
tree | 4e5073d515508b19b20590080a738fe31b9012b8 | |
parent | e07e674527bd7f0d787169ef024c38847316b76f (diff) | |
download | vaadin-framework-c4aff7781269427bd4beccf7fc7d04b8760359b5.tar.gz vaadin-framework-c4aff7781269427bd4beccf7fc7d04b8760359b5.zip |
Fix NPE in fix (#12504)
Change-Id: I65960bcfae850955ea40584445125c0affa26848
-rw-r--r-- | client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java b/client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java index a82bfd1391..d2aadca99b 100644 --- a/client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java +++ b/client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java @@ -178,8 +178,16 @@ public class PopupDateFieldConnector extends TextualDateConnector { public void onStateChanged(StateChangeEvent stateChangeEvent) { super.onStateChanged(stateChangeEvent); getWidget().setTextFieldEnabled(getState().textFieldEnabled); - getWidget().setRangeStart((Date) getState().rangeStart.clone()); - getWidget().setRangeEnd((Date) getState().rangeEnd.clone()); + getWidget().setRangeStart(nullSafeDateClone(getState().rangeStart)); + getWidget().setRangeEnd(nullSafeDateClone(getState().rangeEnd)); + } + + private Date nullSafeDateClone(Date date) { + if (date == null) { + return null; + } else { + return (Date) date.clone(); + } } @Override |