ARTEMIS-2924 prevent NPE

This commit is contained in:
Justin Bertram 2020-09-30 09:56:55 -05:00 committed by Domenico Francesco Bruscino
parent e0c8859367
commit aaba435cae
1 changed files with 4 additions and 4 deletions

View File

@ -824,14 +824,14 @@ public class LoggingResultSet implements ResultSet {
@Override @Override
public Blob getBlob(int columnIndex) throws SQLException { public Blob getBlob(int columnIndex) throws SQLException {
Blob x = resultSet.getBlob(columnIndex); 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; return x;
} }
@Override @Override
public Clob getClob(int columnIndex) throws SQLException { public Clob getClob(int columnIndex) throws SQLException {
Clob x = resultSet.getClob(columnIndex); 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; return x;
} }
@ -859,14 +859,14 @@ public class LoggingResultSet implements ResultSet {
@Override @Override
public Blob getBlob(String columnLabel) throws SQLException { public Blob getBlob(String columnLabel) throws SQLException {
Blob x = resultSet.getBlob(columnLabel); 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; return x;
} }
@Override @Override
public Clob getClob(String columnLabel) throws SQLException { public Clob getClob(String columnLabel) throws SQLException {
Clob x = resultSet.getClob(columnLabel); 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; return x;
} }