aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java12
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