Archiviert
1
0

Fix null Issues

Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Chaoscaot 2021-09-16 22:21:36 +02:00
Ursprung 6490ce2848
Commit d41bb58fac
2 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -27,7 +27,6 @@ import net.dv8tion.jda.api.entities.Emoji;
import net.dv8tion.jda.api.entities.Member; import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.interactions.components.ActionRow; import net.dv8tion.jda.api.interactions.components.ActionRow;
import net.dv8tion.jda.api.interactions.components.Button; import net.dv8tion.jda.api.interactions.components.Button;
import net.md_5.bungee.api.scheduler.ScheduledTask;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;

Datei anzeigen

@ -94,11 +94,15 @@ public class SteamwarUser {
team = rs.getInt("Team"); team = rs.getInt("Team");
leader = rs.getBoolean("Leader"); leader = rs.getBoolean("Leader");
discordId = rs.getLong("DiscordId"); discordId = rs.getLong("DiscordId");
if(rs.wasNull()) {
discordId = null;
}
usersById.put(id, this); usersById.put(id, this);
usersByName.put(userName.toLowerCase(), this); usersByName.put(userName.toLowerCase(), this);
usersByUUID.put(uuid, this); usersByUUID.put(uuid, this);
if(discordId != null) if(discordId != null) {
usersByDiscord.put(discordId, this); usersByDiscord.put(discordId, this);
}
punishments = Punishment.getPunishmentsOfPlayer(id); punishments = Punishment.getPunishmentsOfPlayer(id);
} }