Skip to content

Commit 3701cc2

Browse files
refactor: check if null in PreparedStatement (#1795)
1 parent f105a59 commit 3701cc2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

java/openmldb-jdbc/src/main/java/com/_4paradigm/openmldb/jdbc/PreparedStatement.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,12 @@ protected void dataBuild() throws SQLException {
272272
columnTypes.AddColumnType(types.get(i + 1));
273273
}
274274
this.currentRow = SQLRequestRow.CreateSQLRequestRowFromColumnTypes(columnTypes);
275-
// TODO(hw): check if null
275+
if (this.currentRow == null) {
276+
throw new SQLException("fail to create sql request row from column types");
277+
}
276278
this.currentSchema = this.currentRow.GetSchema();
277279
this.orgTypes = this.types;
278280
}
279-
if (this.currentRow == null) {
280-
throw new SQLException("fail to build data with null row");
281-
}
282281
if (this.currentSchema == null) {
283282
throw new SQLException("fail to build data with null schema");
284283
}

0 commit comments

Comments
 (0)