From 411c2c24c32cf87f55809057749cbb9bd1e2d2b6 Mon Sep 17 00:00:00 2001 From: Nikhil Nandagopal Date: Sun, 25 Oct 2020 12:37:17 +0530 Subject: [PATCH] Added check for config crashing when entity properties are not present (#1394) Co-authored-by: Arpit Mohan --- .../Explorer/Entity/EntityProperties.tsx | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/app/client/src/pages/Editor/Explorer/Entity/EntityProperties.tsx b/app/client/src/pages/Editor/Explorer/Entity/EntityProperties.tsx index 47e1d025ae..992c665289 100644 --- a/app/client/src/pages/Editor/Explorer/Entity/EntityProperties.tsx +++ b/app/client/src/pages/Editor/Explorer/Entity/EntityProperties.tsx @@ -74,19 +74,20 @@ export const EntityProperties = (props: { "CANVAS_WIDGET" | "ICON_WIDGET" | "SKELETON_WIDGET" > = entity.type; config = entityDefinitions[type]; + if (config) { + if (isFunction(config)) config = config(entity); - if (isFunction(config)) config = config(entity); - - entityProperties = Object.keys(config) - .filter(k => k.indexOf("!") === -1) - .map(widgetProperty => { - return { - propertyName: widgetProperty, - entityName: entity.widgetName, - value: entity[widgetProperty], - step: props.step, - }; - }); + entityProperties = Object.keys(config) + .filter(k => k.indexOf("!") === -1) + .map(widgetProperty => { + return { + propertyName: widgetProperty, + entityName: entity.widgetName, + value: entity[widgetProperty], + step: props.step, + }; + }); + } break; } return (