-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolved NPE in self-registering a user to an invalid user realm through API #833
Resolved NPE in self-registering a user to an invalid user realm through API #833
Conversation
...so2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/util/Utils.java
Outdated
Show resolved
Hide resolved
...so2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/util/Utils.java
Outdated
Show resolved
Hide resolved
...so2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/util/Utils.java
Outdated
Show resolved
Hide resolved
...so2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/util/Utils.java
Show resolved
Hide resolved
...so2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/util/Utils.java
Outdated
Show resolved
Hide resolved
...carbon.identity.recovery/src/test/java/org/wso2/carbon/identity/recovery/util/UtilsTest.java
Outdated
Show resolved
Hide resolved
UserStoreManager secondaryUserStoreManager = | ||
((org.wso2.carbon.user.core.UserStoreManager) userStoreManager).getSecondaryUserStoreManager( | ||
user.getUserStoreDomain()); | ||
if (secondaryUserStoreManager != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's return exception if null first and return the result at the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning exception at the end of the logic given a wrong expression.
PR builder started |
PR builder completed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/10035889426
Description
This refactors the getRealmConfiguration method in 'org/wso2/carbon/identity/recovery/util/Utils.java' to handle NullPointerException when retrieving the RealmConfiguration based on the user's domain.
Proposed changes in this pull request
Related Issue
Cause of Issue
The existing implementation did not handle the case where getSecondaryUserStoreManager returned null when an invalid user store domain is provided, which caused an unexpected NullPointerException during runtime.