From 1a2cfc68992eee8ed264076c06d9a7f7b0bdf6cb Mon Sep 17 00:00:00 2001 From: sknirmalkar89 <59080585+sknirmalkar89@users.noreply.github.com> Date: Fri, 4 Feb 2022 14:00:19 +0530 Subject: [PATCH] SB-28404:SB-28404:[SSO > Global consent]issue:Throw consent not found exception list is empty (#1044) * SB-28404:[SSO > Global consent]issue:Throw consent not found exception list is empty --- .../org/sunbird/actor/userconsent/UserConsentActor.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/org/sunbird/actor/userconsent/UserConsentActor.java b/service/src/main/java/org/sunbird/actor/userconsent/UserConsentActor.java index 2fac5ed9e..529895024 100644 --- a/service/src/main/java/org/sunbird/actor/userconsent/UserConsentActor.java +++ b/service/src/main/java/org/sunbird/actor/userconsent/UserConsentActor.java @@ -49,9 +49,13 @@ public class UserConsentActor extends BaseActor { Response response = new Response(); if (CollectionUtils.isNotEmpty(consentList)) { + //Remove revoked consent from the list List<Map<String, Object>> consentResponseList = constructConsentResponse(consentList); - response.put(JsonKey.CONSENT_RESPONSE, consentResponseList); - } else { + consentList=consentResponseList; + } + if(CollectionUtils.isNotEmpty(consentList)){ + response.put(JsonKey.CONSENT_RESPONSE, consentList); + }else { throw new ProjectCommonException( ResponseCode.userConsentNotFound.getErrorCode(), ResponseCode.userConsentNotFound.getErrorMessage(), -- GitLab