From b9fc0f2a6ff53f848d4b5e173e7ecb379c14c63b Mon Sep 17 00:00:00 2001 From: Abhishek Paul Date: Tue, 27 Feb 2024 17:20:04 +0530 Subject: [PATCH] fix(datetimepickerv2withtimespinner): added null undefined check --- .../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}