Skip to content

Commit 3a8574c

Browse files
committed
Issue #658
Corretto nullpointer per la stampa delle ricevute senza dataApplicativa.
1 parent bcae632 commit 3a8574c

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

jars/core/src/main/java/it/govpay/core/business/RicevutaTelematica.java

+14-9
Original file line numberDiff line numberDiff line change
@@ -322,20 +322,25 @@ private ElencoVoci getElencoVoci(CtReceipt rt, List<CtTransferPA> datiSingoloPag
322322

323323

324324
private void setDataApplicativa(RicevutaTelematicaInput input, Date dataRt) {
325-
Calendar cRt = Calendar.getInstance();
326-
cRt.setTime(dataRt);
327-
328-
input.setDataApplicativa( this.sdfSoloData.format(dataRt));
325+
if(dataRt != null) {
326+
input.setDataApplicativa( this.sdfSoloData.format(dataRt));
327+
} else {
328+
input.setDataApplicativa("--");
329+
}
329330
}
330331

331332

332333
private void setDataOperazione(RicevutaTelematicaInput input, Date dataRpt) {
333-
Calendar cRpt = Calendar.getInstance();
334-
cRpt.setTime(dataRpt);
335-
if((cRpt.get(Calendar.HOUR_OF_DAY) + cRpt.get(Calendar.MINUTE) + cRpt.get(Calendar.SECOND)) == 0) {
336-
input.setDataOperazione( this.sdfSoloData.format(dataRpt));
334+
if(dataRpt != null) {
335+
Calendar cRpt = Calendar.getInstance();
336+
cRpt.setTime(dataRpt);
337+
if((cRpt.get(Calendar.HOUR_OF_DAY) + cRpt.get(Calendar.MINUTE) + cRpt.get(Calendar.SECOND)) == 0) {
338+
input.setDataOperazione( this.sdfSoloData.format(dataRpt));
339+
} else {
340+
input.setDataOperazione( this.sdfDataOraMinuti.format(dataRpt));
341+
}
337342
} else {
338-
input.setDataOperazione( this.sdfDataOraMinuti.format(dataRpt));
343+
input.setDataOperazione("--");
339344
}
340345
}
341346

0 commit comments

Comments
 (0)