diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/OPListController.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/OPListController.java index 5a73997..fa889df 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/OPListController.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/OPListController.java @@ -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 selection = workflowController.getWorkitem().getItemValue("$workitemref"); - List 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 selection = workflowController.getWorkitem().getItemValue("$workitemref"); + List 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(); } + return invoiceList; }