Add != null expression to prevent NPE
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user