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

Unpublishing from external stores null pointer exception fixed. #11990

Closed
wants to merge 4 commits into from

Conversation

shnrndk
Copy link
Contributor

@shnrndk shnrndk commented Apr 26, 2023

Purpose

This PR fixes the Internal Server Error while Trying to Remove All Published External API Developer Portals from an API issue.
Related to https://github.com/wso2-enterprise/wso2-apim-internal/issues/2465

Approach

NullPointerException is happening in the org/wso2/carbon/apimgt/rest/api/publisher/v1/impl/ApisApiServiceImpl.java:2182.

  • ExternalStoreId parameter is missing in the request.
  • Since ExternalStoreId is null,
    List<String> externalStoreIdList = Arrays.asList(externalStoreIds.split("\\s*,\\s*"));
    
    splitting occurs the null pointer exception.
  • Added an if condition to check whether the ExternalStoreId is null, and if it is null then it will assign a new empty arraylist.

@shnrndk shnrndk closed this Jul 12, 2023
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.

1 participant