MNT-23276 - Protect from null facet names (#1534) (#1537)

* MNT-23276 - Protect from null facet names (#1534)

(cherry picked from commit 6071188405)
This commit is contained in:
Antonio Felix
2022-11-07 17:11:42 +00:00
committed by GitHub
parent c2d59e2a77
commit e52aa83b43
2 changed files with 9 additions and 6 deletions

View File

@@ -318,8 +318,8 @@ public class DeleteRecordTests extends BaseRMRestTest
RecordCategoryChild recFolder = createFolder(recordCategory.getId(), getRandomName("recFolder"));
RecordBodyFile recordBodyFile = RecordBodyFile.builder().targetParentId(recFolder.getId()).build();
Record recordFiled = getRestAPIFactory().getRecordsAPI().fileRecord(recordBodyFile, testFile.getNodeRefWithoutVersion());
getRestAPIFactory().getRecordsAPI().completeRecord(recordFiled.getId());
assertStatusCode(CREATED);
completeRecord(recordFiled.getId());
assertStatusCode(OK);
STEP("Execute the disposition schedule steps.");
rmRolesAndActionsAPI.executeAction(getAdminUser().getUsername(), getAdminUser().getUsername(), recordFiled.getName(),

View File

@@ -267,10 +267,13 @@ public class SolrJSONResultSet implements SearchEngineResultSet {
ArrayList<Pair<String, Integer>> facetValues = new ArrayList<Pair<String, Integer>>(facetArraySize/2);
for(int i = 0; i < facetArraySize; i+=2)
{
String facetEntryName = facets.getString(i);
Integer facetEntryCount = Integer.valueOf(facets.getInt(i+1));
Pair<String, Integer> pair = new Pair<String, Integer>(facetEntryName, facetEntryCount);
facetValues.add(pair);
if(!facets.isNull(i))
{
String facetEntryName = facets.getString(i);
Integer facetEntryCount = Integer.valueOf(facets.getInt(i + 1));
Pair<String, Integer> pair = new Pair<String, Integer>(facetEntryName, facetEntryCount);
facetValues.add(pair);
}
}
fieldFacets.put(fieldName, facetValues);
}