From aaba435cae8980d86675e4548ba971db862bf166 Mon Sep 17 00:00:00 2001 From: Justin Bertram Date: Wed, 30 Sep 2020 09:56:55 -0500 Subject: [PATCH] ARTEMIS-2924 prevent NPE --- .../artemis/jdbc/store/logging/LoggingResultSet.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/logging/LoggingResultSet.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/logging/LoggingResultSet.java index 476c5bcabb..05dcac429c 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/logging/LoggingResultSet.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/logging/LoggingResultSet.java @@ -824,14 +824,14 @@ public class LoggingResultSet implements ResultSet { @Override public Blob getBlob(int columnIndex) throws SQLException { Blob x = resultSet.getBlob(columnIndex); - logger.logf(level, "%s.getBlob(%s) = %s (length: %d)", resultSetID, columnIndex, x, x.length()); + logger.logf(level, "%s.getBlob(%s) = %s (length: %d)", resultSetID, columnIndex, x, x == null ? null : x.length()); return x; } @Override public Clob getClob(int columnIndex) throws SQLException { Clob x = resultSet.getClob(columnIndex); - logger.logf(level, "%s.getClob(%s) = %s (length: %d)", resultSetID, columnIndex, x, x.length()); + logger.logf(level, "%s.getClob(%s) = %s (length: %d)", resultSetID, columnIndex, x, x == null ? null : x.length()); return x; } @@ -859,14 +859,14 @@ public class LoggingResultSet implements ResultSet { @Override public Blob getBlob(String columnLabel) throws SQLException { Blob x = resultSet.getBlob(columnLabel); - logger.logf(level, "%s.getBlob(%s) = %s (length: %d)", resultSetID, columnLabel, x, x.length()); + logger.logf(level, "%s.getBlob(%s) = %s (length: %d)", resultSetID, columnLabel, x, x == null ? null : x.length()); return x; } @Override public Clob getClob(String columnLabel) throws SQLException { Clob x = resultSet.getClob(columnLabel); - logger.logf(level, "%s.getClob(%s) = %s (length: %d)", resultSetID, columnLabel, x, x.length()); + logger.logf(level, "%s.getClob(%s) = %s (length: %d)", resultSetID, columnLabel, x, x == null ? null : x.length()); return x; }