Add != null expression to prevent NPE
This commit is contained in:
@@ -810,7 +810,7 @@ public class ZUGFeRDImporter {
|
|||||||
node = getNodeByName(tradeAgreementChildren, "ram:ChargeAmount");
|
node = getNodeByName(tradeAgreementChildren, "ram:ChargeAmount");
|
||||||
lineItem.setPrice(tryBigDecimal(getNodeValue(node)));
|
lineItem.setPrice(tryBigDecimal(getNodeValue(node)));
|
||||||
node = getNodeByName(tradeAgreementChildren, "ram:BasisQuantity");
|
node = getNodeByName(tradeAgreementChildren, "ram:BasisQuantity");
|
||||||
if(node.getAttributes()!=null) {
|
if(node != null && node.getAttributes()!=null) {
|
||||||
Node unitCodeAttribute = node.getAttributes().getNamedItem("unitCode");
|
Node unitCodeAttribute = node.getAttributes().getNamedItem("unitCode");
|
||||||
if(unitCodeAttribute != null) {
|
if(unitCodeAttribute != null) {
|
||||||
lineItem.getProduct().setUnit(unitCodeAttribute.getNodeValue());
|
lineItem.getProduct().setUnit(unitCodeAttribute.getNodeValue());
|
||||||
|
|||||||
Reference in New Issue
Block a user