From 220b28df3e2aed42f91552e6df0c6b29972c9d0d Mon Sep 17 00:00:00 2001 From: Pawan Kumar Date: Fri, 5 Mar 2021 10:04:35 +0530 Subject: [PATCH] Fix: TypeError: e is undefined (#3337) * add conditional operator * check for widget before calling the function * check for widget exisitence Co-authored-by: Pawan Kumar --- app/client/src/sagas/WidgetOperationSagas.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/client/src/sagas/WidgetOperationSagas.tsx b/app/client/src/sagas/WidgetOperationSagas.tsx index 12bfbc18cd..f2d0b40167 100644 --- a/app/client/src/sagas/WidgetOperationSagas.tsx +++ b/app/client/src/sagas/WidgetOperationSagas.tsx @@ -896,6 +896,10 @@ function* batchUpdateWidgetPropertySaga( const { modify = {}, remove = [] } = updates; const stateWidget: WidgetProps = yield select(getWidget, widgetId); + + // if there is no widget in the state, don't do anything + if (!stateWidget) return; + let widget = cloneDeep(stateWidget); try { if (Object.keys(modify).length > 0) {