Skip to content

Commit fa897d3

Browse files
authored
Fixed possibly NPE (#128)
2 parents 4063fce + 5e3e4fb commit fa897d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jdbc/src/main/java/tech/ydb/jdbc/impl/BaseYdbResultSet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ private ValueReader readValue(int columnIndex) throws SQLException {
9191
throw new SQLException(YdbConst.COLUMN_NUMBER_NOT_FOUND + columnIndex);
9292
}
9393

94-
ValueReader value = getValue(columnIndex - 1);
94+
ValueReader v = getValue(columnIndex - 1);
9595
ColumnInfo type = columns[columnIndex - 1];
96-
wasNull = type == null || type.isNull() || (type.isOptional() && !value.isOptionalItemPresent());
97-
return value;
96+
wasNull = type == null || v == null || type.isNull() || (type.isOptional() && !v.isOptionalItemPresent());
97+
return v;
9898
}
9999

100100
@Override

0 commit comments

Comments
 (0)