Skip to content

Commit

Permalink
fix: checking for timerange prop before accessing properties
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-y committed Dec 19, 2023
1 parent ef9e9a4 commit 60a768f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/time-range-picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const TimeRangePicker = ({ timeRange, onChange }) => {

const toggleCustomHandler = () => {
if (!isCustomOpen) {
if (timeRange['begin_time'] && timeRange['end_time']) {
if (timeRange && timeRange['begin_time'] && timeRange['end_time']) {
setBeginTime(timeRange['begin_time']);
setEndTime(timeRange['end_time']);
} else {
Expand Down

0 comments on commit 60a768f

Please sign in to comment.