From 038c82857313c9ba5d15557629d38bdc92c03059 Mon Sep 17 00:00:00 2001 From: abpaul1993 <136786799+abpaul1993@users.noreply.github.com> Date: Tue, 27 Feb 2024 18:38:27 +0530 Subject: [PATCH] fix(datetimepickerv2withtimespinner): added null undefined check (#3845) --- .../DateTimePicker/DateTimePickerV2WithTimeSpinner.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react/src/components/DateTimePicker/DateTimePickerV2WithTimeSpinner.jsx b/packages/react/src/components/DateTimePicker/DateTimePickerV2WithTimeSpinner.jsx index 35678bc72e..a8529d8de1 100644 --- a/packages/react/src/components/DateTimePicker/DateTimePickerV2WithTimeSpinner.jsx +++ b/packages/react/src/components/DateTimePicker/DateTimePickerV2WithTimeSpinner.jsx @@ -1042,7 +1042,7 @@ const DateTimePicker = ({ [`${iotPrefix}--date-time-picker__disabled`]: disabled || (isSingleSelect && - (!singleDateValue.startDate || (hasTimeInput ? !singleTimeValue : false))), + (!singleDateValue?.startDate || (hasTimeInput ? !singleTimeValue : false))), // singleDateValue might be null or undefined })} title={humanValue} > @@ -1314,7 +1314,7 @@ const DateTimePicker = ({ absoluteValue && datePickerType === 'range' ? [absoluteValue.startDate, absoluteValue.endDate] : singleDateValue && datePickerType === 'single' - ? [singleDateValue.startDate] + ? [singleDateValue?.startDate] : null } locale={locale}