Skip to content

Commit

Permalink
fix a different crash
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNavaStar committed Jul 21, 2024
1 parent 591b2f5 commit 82207c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/me/mrnavastar/sqlib/impl/SQLConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void deleteRow(DataStore store, int id) {

public boolean rowExists(DataStore store, int id) {
try (Handle h = sql.open()) {
return h.select("SELECT 1 FROM %s WHERE SQLIB_AUTO_ID = ?".formatted(store.toString()), id).mapTo(Integer.class).one() != null;
return h.select("SELECT 1 FROM %s WHERE SQLIB_AUTO_ID = ?".formatted(store.toString()), id).mapTo(Integer.class).findFirst().isPresent();
}
}

Expand Down

0 comments on commit 82207c1

Please sign in to comment.