From 1e000c295f8dce8ecb41ac700f367e8e853c5891 Mon Sep 17 00:00:00 2001 From: Trisha Anand Date: Mon, 20 Apr 2020 13:58:25 +0530 Subject: [PATCH] In case the children tag exists in the DSL but is empty, we shouldnt try to extract widget names in that scenario. --- .../appsmith/server/services/LayoutActionServiceImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/LayoutActionServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/LayoutActionServiceImpl.java index fec19773a8..e6909a7b86 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/LayoutActionServiceImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/LayoutActionServiceImpl.java @@ -19,6 +19,7 @@ import net.minidev.json.parser.JSONParser; import net.minidev.json.parser.ParseException; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import reactor.core.publisher.Flux; @@ -432,8 +433,11 @@ public class LayoutActionServiceImpl implements LayoutActionService { for (int i = 0; i < children.size(); i++) { Map data = (Map) children.get(i); JSONObject object = new JSONObject(); - object.putAll(data); - extractAllWidgetNamesFromDSL(object, widgetNames); + // If the children tag exists and there are entries within it + if (!CollectionUtils.isEmpty(data)) { + object.putAll(data); + extractAllWidgetNamesFromDSL(object, widgetNames); + } } } }