Skip to content

Commit 6facd20

Browse files
committed
Fix last custom attribute not deleting issue
1 parent 89c3ae5 commit 6facd20

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/v1/utils/mappings/throttling/SubscriptionThrottlePolicyMappingUtil.java

+3
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ public static SubscriptionPolicy fromSubscriptionThrottlePolicyDTOToModel(Subscr
136136
customAttrJsonArray.add(attrJsonObj);
137137
}
138138
subscriptionPolicy.setCustomAttributes(customAttrJsonArray.toJSONString().getBytes());
139+
} else {
140+
//if no custom attributes are set, assign an empty byte array
141+
subscriptionPolicy.setCustomAttributes(new JSONArray().toJSONString().getBytes());
139142
}
140143
if (dto.getMonetization() != null &&
141144
StringUtils.isNotBlank(dto.getMonetization().getMonetizationPlan().name())) {

0 commit comments

Comments
 (0)