prevent possible nullpointerex
This commit is contained in:
@@ -343,6 +343,9 @@ public class ZUGFeRDImporter extends ZUGFeRDInvoiceImporter {
|
|||||||
* @return the sender's account IBAN code
|
* @return the sender's account IBAN code
|
||||||
*/
|
*/
|
||||||
public String getIBAN() {
|
public String getIBAN() {
|
||||||
|
if ((importedInvoice==null)||(importedInvoice.getTradeSettlement()==null)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
for (IZUGFeRDTradeSettlement settlement : importedInvoice.getTradeSettlement()) {
|
for (IZUGFeRDTradeSettlement settlement : importedInvoice.getTradeSettlement()) {
|
||||||
if (settlement instanceof IZUGFeRDTradeSettlementDebit) {
|
if (settlement instanceof IZUGFeRDTradeSettlementDebit) {
|
||||||
return ((IZUGFeRDTradeSettlementDebit) settlement).getIBAN();
|
return ((IZUGFeRDTradeSettlementDebit) settlement).getIBAN();
|
||||||
@@ -356,8 +359,6 @@ public class ZUGFeRDImporter extends ZUGFeRDInvoiceImporter {
|
|||||||
|
|
||||||
|
|
||||||
public String getHolder() {
|
public String getHolder() {
|
||||||
|
|
||||||
|
|
||||||
return extractString("//*[local-name() = 'SellerTradeParty']/*[local-name() = 'Name']");
|
return extractString("//*[local-name() = 'SellerTradeParty']/*[local-name() = 'Name']");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,7 +367,6 @@ public class ZUGFeRDImporter extends ZUGFeRDInvoiceImporter {
|
|||||||
* @return the total payable amount
|
* @return the total payable amount
|
||||||
*/
|
*/
|
||||||
public String getAmount() {
|
public String getAmount() {
|
||||||
|
|
||||||
return importedInvoice.getGrandTotal().toPlainString();
|
return importedInvoice.getGrandTotal().toPlainString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user