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 <pawankumar@Pawans-MacBook-Pro.local>
This commit is contained in:
Pawan Kumar 2021-03-05 10:04:35 +05:30 committed by GitHub
parent 71f4a4b0a9
commit 220b28df3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {