Skip to content

Commit

Permalink
Fix isEnableSpy repository method issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Brikster committed Oct 29, 2024
1 parent cd1e56c commit 08fd97c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ public boolean isEnableSpy(@NotNull UUID playerUuid) {
statement.setString(1, playerUuid.toString());

ResultSet resultSet = statement.executeQuery();
return resultSet.getBoolean("spy");
if (resultSet.next()) {
return resultSet.getBoolean("spy");
} else {
return false;
}
} catch (SQLException sqlException) {
throw new IllegalStateException("Cannot check player spy mode", sqlException);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,11 @@ public boolean isEnableSpy(@NotNull UUID playerUuid) {
statement.setString(1, playerUuid.toString());

ResultSet resultSet = statement.executeQuery();
return resultSet.getBoolean("spy");
if (resultSet.next()) {
return resultSet.getBoolean("spy");
} else {
return false;
}
} catch (SQLException sqlException) {
throw new IllegalStateException("Cannot check player spy mode", sqlException);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,11 @@ public boolean isEnableSpy(@NotNull UUID playerUuid) {
statement.setBytes(1, SqliteUtil.fromUUID(playerUuid));

ResultSet resultSet = statement.executeQuery();
return resultSet.getBoolean("spy");
if (resultSet.next()) {
return resultSet.getBoolean("spy");
} else {
return false;
}
} catch (SQLException sqlException) {
throw new IllegalStateException("Cannot check player spy mode", sqlException);
}
Expand Down

0 comments on commit 08fd97c

Please sign in to comment.