From b9d0eb5d6ca975221ac3898502096322694acd91 Mon Sep 17 00:00:00 2001 From: Diego Date: Mon, 27 Feb 2017 12:10:13 +0100 Subject: [PATCH] [CONJ-410] merging correction to handle null value for Java 8 Offset's DateTime 6 - part 2 --- .../queryresults/resultset/SelectResultSet.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/mariadb/jdbc/internal/queryresults/resultset/SelectResultSet.java b/src/main/java/org/mariadb/jdbc/internal/queryresults/resultset/SelectResultSet.java index c7a3921bd..d2df89a1c 100644 --- a/src/main/java/org/mariadb/jdbc/internal/queryresults/resultset/SelectResultSet.java +++ b/src/main/java/org/mariadb/jdbc/internal/queryresults/resultset/SelectResultSet.java @@ -1935,29 +1935,29 @@ public T getObject(int columnIndex, Class type) throws SQLException { return (T) getBigInteger(rawBytes, col); case "java.time.LocalDateTime": - if (rawBytes == null && rawBytes.length == 0) return null; + if (rawBytes == null || rawBytes.length == 0) return null; ZonedDateTime zonedDateTime = getZonedDateTime(rawBytes, col, LocalDateTime.class); return zonedDateTime == null ? null : type.cast(zonedDateTime.withZoneSameInstant(ZoneId.systemDefault()).toLocalDateTime()); case "java.time.ZonedDateTime": - if (rawBytes == null && rawBytes.length == 0) return null; + if (rawBytes == null || rawBytes.length == 0) return null; return type.cast(getZonedDateTime(rawBytes, col, ZonedDateTime.class)); case "java.time.OffsetDateTime": - if (rawBytes == null && rawBytes.length == 0) return null; + if (rawBytes == null || rawBytes.length == 0) return null; ZonedDateTime tmpZonedDateTime = getZonedDateTime(rawBytes, col, OffsetDateTime.class); return tmpZonedDateTime == null ? null : type.cast(tmpZonedDateTime.toOffsetDateTime()); case "java.time.LocalDate": - if (rawBytes == null && rawBytes.length == 0) return null; + if (rawBytes == null || rawBytes.length == 0) return null; return type.cast(getLocalDate(rawBytes, col)); case "java.time.LocalTime": - if (rawBytes == null && rawBytes.length == 0) return null; + if (rawBytes == null || rawBytes.length == 0) return null; return type.cast(getLocalTime(rawBytes, col)); case "java.time.OffsetTime": - if (rawBytes == null && rawBytes.length == 0) return null; + if (rawBytes == null || rawBytes.length == 0) return null; return type.cast(getOffsetTime(rawBytes, col)); default: