-
Notifications
You must be signed in to change notification settings - Fork 644
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
Fix null pointer exception when the tenant is invalid #13058
base: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe changes introduce a new condition in the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant APIUtil
Caller->>APIUtil: call isUserExist(username)
APIUtil->>APIUtil: Retrieve tenant ID
alt Tenant ID equals -1
APIUtil-->>Caller: throw APIManagementException (INVALID_TENANT)
else Tenant exists
APIUtil-->>Caller: Return user existence result
end
Assessment against linked issues
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (6)
🔇 Additional comments (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Purpose
When trying to change the API Provider through admin portal, if an invalid tenant name is given as input, (
john@ a bc.com
-> space within the tenant domain or[email protected]
wheretest.com
does not exists) an NPE is thrown. This PR fixes that issue.Fixes: wso2/api-manager#3735
Implementation Details
If the tenant is invalid, the
tenantId
becomes-1
. If that happens, anAPIManagementException
is now thrown withINVALID_TENANT
as the ExceptionCode.