Bugfix in ZUGFeRD2PullProvider.generateXML(): Test for valid value of getDueDate() before using it

or a NullPointerException might happen as 'hasDueDate==true' is not the result
of a test to ensure that 'trans' overwrites 'getDueDate()' at all, so the default
implementation from 'IZUGFeRDExportableTransaction' might get used which returns
the unusable result 'null'.
This commit is contained in:
Jens Heise
2020-05-06 23:31:21 +02:00
parent 6e9c0e8903
commit d1200a8dcd

View File

@@ -516,7 +516,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
}
}
if (hasDueDate) {
if (hasDueDate && (trans.getDueDate()!=null)) {
xml = xml + " <ram:DueDateDateTime><udt:DateTimeString format=\"102\">" // $NON-NLS-2$
+ zugferdDateFormat.format(trans.getDueDate())
+ "</udt:DateTimeString></ram:DueDateDateTime>\n";// 20130704 //$NON-NLS-1$