Avoid assigning an empty list, in case the "reportItems" is null, inside "SushiliteServiceImpl.getReportResults()".

This commit is contained in:
Lampros Smyrnaios 2023-03-29 12:08:43 +03:00
parent 54ebb35161
commit 0ce67b6355
1 changed files with 3 additions and 3 deletions

View File

@ -93,8 +93,8 @@ public class SushiliteServiceImpl implements SushiliteService {
List<ReportItem> requestedItemList = new ArrayList<>();
Customer customer = reportResponseWrapper.getReportResponse().getReportWrapper().getReport().getCustomer();
List<ReportItem> allReportItems = customer.getReportItems();
List<ReportItem> allReportItems = customer.getReportItems();
if ( allReportItems != null ) {
try {
int totalItems = allReportItems.size();
@ -111,9 +111,9 @@ public class SushiliteServiceImpl implements SushiliteService {
logger.error("Exception on getReportResults - trying to cast strings to integers", e);
throw e;
}
}
customer.setReportItems(requestedItemList); // Setting the reportItems to the "customer"-reference, updates the "reportResponseWrapper" object.
customer.setReportItems(requestedItemList); // Setting the reportItems to the "customer"-reference, updates the "reportResponseWrapper" object.
}
return reportResponseWrapper;
}