The following case throws a NPE
Date defaultEpochDate = new Date(0);
mapToTimestamp(defaultEpochDate.toInstant())
The problem is for this case EpochSecond and Nano are 0 and this builder does not allow it.
|
Timestamp t = Timestamp.newBuilder().setSeconds(i.getEpochSecond()).setNanos(i.getNano()).build(); |
I think the solution could be to handle the 0 seconds case and use the Timestamp.getDefaultInstance() instead.
The following case throws a NPE
The problem is for this case EpochSecond and Nano are 0 and this builder does not allow it.
mapstruct-spi-protobuf/support-core/src/main/java/no/entur/abt/mapstruct/common/ProtobufStandardMappings.java
Line 164 in 7ffeba8
I think the solution could be to handle the 0 seconds case and use the Timestamp.getDefaultInstance() instead.