Skip to content
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 the null pointer for operation json list. #406

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Malith-19
Copy link

@Malith-19 Malith-19 commented Jul 1, 2024

Purpose

Fix wso2/product-is#19409

This issue occures, when a invalid operation schema field given since it only accepts Operations field. Once json schema not contains this fieed correctly it will create a null pointer and raise an error in a for loop used to iterate that operation list.

Goals

Handle the internal error in PATCH scim2/v2/roles/{id} API.

Approach

  • Check weather operation list is null first.
  • If yes, then it checks json schema contains operations field and throws an bad request error with invalid json schema.
  • If operation list is null and still not has operations throws an bad request error with default error description.

Security checks

Samples

image

Related PRs

wso2/docs-is#4395

@Malith-19 Malith-19 self-assigned this Jul 1, 2024
@Malith-19 Malith-19 requested a review from ashensw July 1, 2024 04:48

//check if operationJsonList is null
if (operationJsonList == null) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove new lines Line 759, 764

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by 14c2ca2

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/9740839123

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/9740839123
Status: success

Copy link

@jenkins-is-staging jenkins-is-staging left a 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/9740839123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SCIM API returns 500 for invalid request body
3 participants