From 22e125786463c00650f115130935c14d41cf9552 Mon Sep 17 00:00:00 2001 From: Pavindu Lakshan Date: Sat, 3 Aug 2024 23:11:53 +0530 Subject: [PATCH] Prevent throwing 404 for deleting branding preferece request when branding preference is not already configured --- .../v1/core/BrandingPreferenceManagementService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.v1/src/main/java/org/wso2/carbon/identity/api/server/branding/preference/management/v1/core/BrandingPreferenceManagementService.java b/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.v1/src/main/java/org/wso2/carbon/identity/api/server/branding/preference/management/v1/core/BrandingPreferenceManagementService.java index 3dc9944039..b05791526d 100644 --- a/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.v1/src/main/java/org/wso2/carbon/identity/api/server/branding/preference/management/v1/core/BrandingPreferenceManagementService.java +++ b/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.v1/src/main/java/org/wso2/carbon/identity/api/server/branding/preference/management/v1/core/BrandingPreferenceManagementService.java @@ -133,8 +133,7 @@ public void deleteBrandingPreference(String type, String name, String locale) { if (log.isDebugEnabled()) { log.debug("Can not find a branding preferences to delete for tenant: " + tenantDomain, e); } - throw handleException(Response.Status.NOT_FOUND, ERROR_CODE_BRANDING_PREFERENCE_NOT_EXISTS, - tenantDomain); + return; } throw handleBrandingPreferenceMgtException(e, ERROR_CODE_ERROR_DELETING_BRANDING_PREFERENCE, tenantDomain); }