Skip to content

Commit

Permalink
Added error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinSMueller committed Aug 23, 2022
1 parent 7546cea commit 36bb50d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main/java/gov/nih/nci/bento/model/PrivateESDataFetcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,17 @@ private List<Map<String, Object>> fileOverview(Map<String, Object> params) throw

List<Map<String, Object>> result = overview(FILES_END_POINT, params, PROPERTIES, defaultSort, mapping);
final String ACL_KEY = "acl";
for(Map<String, Object> resultElement: result){
String acl = (String) resultElement.get(ACL_KEY);
String[] acls = acl.replaceAll("\\]|\\[|'", "").split(",");
resultElement.put(ACL_KEY, acls);
try{
for(Map<String, Object> resultElement: result){
String acl = (String) resultElement.get(ACL_KEY);
String[] acls = acl.replaceAll("\\]|\\[|'|\"", "").split(",");
resultElement.put(ACL_KEY, acls);
}
}
catch(ClassCastException | NullPointerException ex){
logger.error("Error occurred when splitting acl into String array");
}

return result;
}

Expand Down

0 comments on commit 36bb50d

Please sign in to comment.