fix null pointer exception

This commit is contained in:
Ralph Soika 2023-06-13 11:01:33 +02:00
parent 7902df76a9
commit d8bfc6ce39

View file

@ -189,21 +189,27 @@ public class OPListController implements Serializable {
// finally we set the 'selection' item depending on the $workitemList
// and the payment amount form the 'payment.details'
List<String> selection = workflowController.getWorkitem().getItemValue("$workitemref");
List<ItemCollection> paymentList = zahlungseingangService.loadPaymentDetails(workflowController.getWorkitem());
for (ItemCollection invoice : invoiceList) {
if (selection.contains(invoice.getUniqueID())) {
invoice.setItemValue("selected", true);
// set amount
for (ItemCollection payment : paymentList) {
if (invoice.getUniqueID().equals(payment.getUniqueID())) {
invoice.setItemValue("payment.amount", payment.getItemValue("payment.amount"));
break;
if (invoiceList!=null) {
List<String> selection = workflowController.getWorkitem().getItemValue("$workitemref");
List<ItemCollection> paymentList = zahlungseingangService.loadPaymentDetails(workflowController.getWorkitem());
for (ItemCollection invoice : invoiceList) {
if (selection.contains(invoice.getUniqueID())) {
invoice.setItemValue("selected", true);
// set amount
for (ItemCollection payment : paymentList) {
if (invoice.getUniqueID().equals(payment.getUniqueID())) {
invoice.setItemValue("payment.amount", payment.getItemValue("payment.amount"));
break;
}
}
}
}
} else {
// empty list
invoiceList = new ArrayList<ItemCollection>();
}
return invoiceList;
}