diff --git a/src/main/java/edu/harvard/dbmi/avillach/dictionary/dashboarddrawer/DashboardDrawerRowMapper.java b/src/main/java/edu/harvard/dbmi/avillach/dictionary/dashboarddrawer/DashboardDrawerRowMapper.java index 09eb99b..02ff597 100644 --- a/src/main/java/edu/harvard/dbmi/avillach/dictionary/dashboarddrawer/DashboardDrawerRowMapper.java +++ b/src/main/java/edu/harvard/dbmi/avillach/dictionary/dashboarddrawer/DashboardDrawerRowMapper.java @@ -25,10 +25,16 @@ public DashboardDrawer mapRow(ResultSet rs, int rowNum) throws SQLException { } private List convertSqlArrayToList(Array sqlArray) throws SQLException { - if (sqlArray == null) { + if (sqlArray == null ) { return List.of(); + } else { + Object[] arrayContents = (Object[]) sqlArray.getArray(); + // Check if the array contains a single empty value + if (arrayContents.length == 1 && "".equals(arrayContents[0])) { + return List.of(); + } else { + return Arrays.asList((String[]) sqlArray.getArray()); + } } - // Convert SQL Array to Java Array, then to List - return Arrays.asList((String[]) sqlArray.getArray()); } } \ No newline at end of file