Change-Id: I65960bcfae850955ea40584445125c0affa26848
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