Skip to content

Commit 2ca7139

Browse files
committed
fix: handle null values in IntervalConverter and TimestampConverter
1 parent c1717ee commit 2ca7139

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

jooq-dialect/src/main/java/tech/ydb/jooq/binding/IntervalBinding.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ public void get(BindingGetResultSetContext<Duration> ctx) throws SQLException {
3939
private static class IntervalConverter implements Converter<YearToSecond, Duration> {
4040
@Override
4141
public Duration from(YearToSecond databaseObject) {
42+
if (databaseObject == null) {
43+
return null;
44+
}
4245
return databaseObject.toDuration();
4346
}
4447

jooq-dialect/src/main/java/tech/ydb/jooq/binding/TimestampBinding.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ public void get(BindingGetResultSetContext<Instant> ctx) throws SQLException {
3939
private static class TimestampConverter implements Converter<LocalDateTime, Instant> {
4040
@Override
4141
public Instant from(LocalDateTime databaseObject) {
42+
if (databaseObject == null) {
43+
return null;
44+
}
4245
return databaseObject.toInstant(ZoneOffset.UTC);
4346
}
4447

0 commit comments

Comments
 (0)