#863 Fixes NPE in LineCalculator

This commit is contained in:
Daniel Luckas
2025-06-12 08:05:21 +00:00
parent dfcc5f1a1c
commit 78a6262a71

View File

@@ -74,6 +74,7 @@ public class LineCalculator {
// delta=delta.divide(currentItem.getQuantity(), 18, RoundingMode.HALF_UP);
BigDecimal delta=BigDecimal.ZERO;
if(currentItem.getProduct()!=null){
if (currentItem.getProduct().getAllowances()!=null) {
for (IZUGFeRDAllowanceCharge ccaf:currentItem.getProduct().getAllowances()) {
delta=delta.subtract(ccaf.getTotalAmount(currentItem));
@@ -84,6 +85,7 @@ public class LineCalculator {
delta = delta.subtract(ccaf.getTotalAmount(currentItem));
}
}
}
price=price.add(delta);
// Division/Zero occurred here.