fix /pronouns reset command

Fix crash when resetting pronouns due to null value in database write
This commit is contained in:
2025-05-07 23:59:32 -07:00
parent 2eea920d65
commit 38458492e6
3 changed files with 18 additions and 7 deletions

View File

@@ -68,6 +68,17 @@ public class PronounsPlugin extends JavaPlugin {
}
public void setPronouns(UUID uuid, String pronouns) {
if (pronouns == null) {
try (PreparedStatement ps = connection.prepareStatement("DELETE FROM pronouns WHERE uuid = ?")) {
ps.setString(1, uuid.toString());
ps.executeUpdate();
} catch (SQLException e) {
errorLog.add("Database delete error: " + e.getMessage());
e.printStackTrace();
}
return;
}
for (String blocked : blockedPronouns) {
if (pronouns.contains(blocked)) {
return;

View File

@@ -17,11 +17,11 @@ blocked-pronouns:
- "spic"
pronoun-suggestions:
- "she/her"
- "he/him"
- "they/them"
- "xe/xem"
- "it/its"
- "She/Her"
- "He/Him"
- "They/Them"
- "Xe/Xem"
- "It/Its"
debug: true