Add != null expression to prevent NPE

This commit is contained in:
Sebastian Sieber
2020-11-27 12:51:10 +01:00
parent bd720e38f7
commit 751d129def

View File

@@ -810,7 +810,7 @@ public class ZUGFeRDImporter {
node = getNodeByName(tradeAgreementChildren, "ram:ChargeAmount");
lineItem.setPrice(tryBigDecimal(getNodeValue(node)));
node = getNodeByName(tradeAgreementChildren, "ram:BasisQuantity");
if(node.getAttributes()!=null) {
if(node != null && node.getAttributes()!=null) {
Node unitCodeAttribute = node.getAttributes().getNamedItem("unitCode");
if(unitCodeAttribute != null) {
lineItem.getProduct().setUnit(unitCodeAttribute.getNodeValue());