From 8e9e7e82e1bc20aac4893bab0a0d4b427bc1ffca Mon Sep 17 00:00:00 2001 From: asha15 <165079T@uom.lk> Date: Sat, 18 Nov 2023 14:29:12 +0530 Subject: [PATCH] add null check for recoveryInformationDTO --- .../user/recovery/v1/impl/core/PasswordRecoveryService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/org.wso2.carbon.identity.api.user.recovery/org.wso2.carbon.identity.rest.api.user.recovery.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/recovery/v1/impl/core/PasswordRecoveryService.java b/components/org.wso2.carbon.identity.api.user.recovery/org.wso2.carbon.identity.rest.api.user.recovery.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/recovery/v1/impl/core/PasswordRecoveryService.java index 2c9544be2..5e35f762d 100644 --- a/components/org.wso2.carbon.identity.api.user.recovery/org.wso2.carbon.identity.rest.api.user.recovery.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/recovery/v1/impl/core/PasswordRecoveryService.java +++ b/components/org.wso2.carbon.identity.api.user.recovery/org.wso2.carbon.identity.rest.api.user.recovery.v1/src/main/java/org/wso2/carbon/identity/rest/api/user/recovery/v1/impl/core/PasswordRecoveryService.java @@ -437,8 +437,14 @@ private AccountRecoveryType buildPasswordRecoveryInitResponse(String tenantDomai RecoveryInformationDTO recoveryInformationDTO) { AccountRecoveryType accountRecoveryType = null; + + if (recoveryInformationDTO == null) { + return accountRecoveryType; + } + boolean isNotificationBasedRecoveryEnabled = recoveryInformationDTO.isNotificationBasedRecoveryEnabled(); boolean isQuestionBasedRecoveryAllowedForUser = recoveryInformationDTO.isQuestionBasedRecoveryAllowedForUser(); + if (isNotificationBasedRecoveryEnabled) { // Build next API calls list. ArrayList apiCallsArrayList = new ArrayList<>();