diff --git a/src/main/java/world/bentobox/bentobox/database/sqlite/SQLiteDatabaseHandler.java b/src/main/java/world/bentobox/bentobox/database/sqlite/SQLiteDatabaseHandler.java index 54f37561a..3eaf2e908 100644 --- a/src/main/java/world/bentobox/bentobox/database/sqlite/SQLiteDatabaseHandler.java +++ b/src/main/java/world/bentobox/bentobox/database/sqlite/SQLiteDatabaseHandler.java @@ -205,9 +205,12 @@ public class SQLiteDatabaseHandler extends AbstractJSONDatabaseHandler { dataObject.getCanonicalName() + "` WHERE uniqueId = ?"; try (PreparedStatement preparedStatement = connection.prepareStatement(sb)) { - // UniqueId needs to be placed in quotes - preparedStatement.setString(1, "\"" + uniqueId + "\""); - preparedStatement.execute(); + // UniqueId must not be placed in quotes + preparedStatement.setString(1, uniqueId); + int result = preparedStatement.executeUpdate(); + if (result != 1) { + throw new SQLException("Delete did not affect any rows!"); + } } catch (Exception e) { plugin.logError("Could not delete object " + dataObject.getCanonicalName() + " " + uniqueId + " " + e.getMessage()); }