diff --git a/app/client/src/sagas/WidgetSelectionSagas.ts b/app/client/src/sagas/WidgetSelectionSagas.ts index cca32202f7..733ba1108d 100644 --- a/app/client/src/sagas/WidgetSelectionSagas.ts +++ b/app/client/src/sagas/WidgetSelectionSagas.ts @@ -419,7 +419,7 @@ function* openOrCloseModalSaga( const widget = widgetMap[action.payload.widgetId]; - if (widget.parentId) { + if (widget && widget.parentId) { const widgetInModal = modalWidgetIds.includes(widget.parentModalId); if (widgetInModal) { yield put(showModal(widget.parentModalId));