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