From 20ed017a5887a25d42a3e2a30a12e42cd6b54e28 Mon Sep 17 00:00:00 2001 From: Trisha Anand Date: Thu, 4 Mar 2021 15:35:46 +0530 Subject: [PATCH] In case of no mustache bindings are found in dynamic path list, throw invalid dynamic binding reference error. (#3394) --- .../appsmith/server/services/LayoutActionServiceImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 ca682ae798..5a64884605 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 @@ -346,6 +346,13 @@ public class LayoutActionServiceImpl implements LayoutActionService { // Only extract mustache keys from leaf nodes if (parent != null && isLeafNode) { Set mustacheKeysFromFields = MustacheHelper.extractMustacheKeysFromFields(parent); + + // We found the path. But if the path does not have any mustache bindings, throw the error + if (mustacheKeysFromFields.isEmpty()) { + throw new AppsmithException(AppsmithError.INVALID_DYNAMIC_BINDING_REFERENCE, widgetType, + widgetName, widgetId, fieldPath, pageId, layoutId); + } + dynamicBindings.addAll(mustacheKeysFromFields); } }