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); } }