From 36bb50d1224ae6674fc7935b26a3aa4d58b095a9 Mon Sep 17 00:00:00 2001 From: Austin Mueller <64418315+AustinSMueller@users.noreply.github.com> Date: Tue, 23 Aug 2022 14:04:58 -0400 Subject: [PATCH] Added error handling --- .../nih/nci/bento/model/PrivateESDataFetcher.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/gov/nih/nci/bento/model/PrivateESDataFetcher.java b/src/main/java/gov/nih/nci/bento/model/PrivateESDataFetcher.java index e55a082fc..bec77e7c8 100644 --- a/src/main/java/gov/nih/nci/bento/model/PrivateESDataFetcher.java +++ b/src/main/java/gov/nih/nci/bento/model/PrivateESDataFetcher.java @@ -372,11 +372,17 @@ private List> fileOverview(Map params) throw List> result = overview(FILES_END_POINT, params, PROPERTIES, defaultSort, mapping); final String ACL_KEY = "acl"; - for(Map resultElement: result){ - String acl = (String) resultElement.get(ACL_KEY); - String[] acls = acl.replaceAll("\\]|\\[|'", "").split(","); - resultElement.put(ACL_KEY, acls); + try{ + for(Map 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; }