Skip to content

Commit

Permalink
Fix possible NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
sadilchamishka committed Jan 7, 2025
1 parent 6f06337 commit 88c1460
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/org/wso2/scim2/util/SCIMDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ public List<SCIMObject> decodeListedResource(String scimString, ResourceTypeSche

//we expect this to be a non-empty JSONArray according to the format
Object resources = decodedJsonObj.opt(SCIMConstants.ListedResourceSchemaConstants.RESOURCES);
scimObjects = new ArrayList<SCIMObject>();
scimObjects = new ArrayList<>();
if (resources == null) {
return scimObjects;
}
decoder = new JSONDecoder();
for (int i = 0; i < (((JSONArray) resources).length()); i++) {
Object object = ((JSONArray) resources).get(i);
Expand Down

0 comments on commit 88c1460

Please sign in to comment.