Hotfix NPE
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2023-02-24 17:08:18 +01:00
Ursprung 38457db014
Commit ec9d56dab9

Datei anzeigen

@ -75,6 +75,7 @@ public class SteamwarUser {
return; return;
usersByName.remove(user.getUserName()); usersByName.remove(user.getUserName());
usersByUUID.remove(user.getUUID()); usersByUUID.remove(user.getUUID());
usersByDiscord.remove(user.getDiscordId());
} }
public static SteamwarUser get(String userName){ public static SteamwarUser get(String userName){
@ -105,7 +106,7 @@ public class SteamwarUser {
} }
public static SteamwarUser getOrCreate(UUID uuid, String name, Consumer<UUID> newPlayer, BiConsumer<String, String> nameUpdate) { public static SteamwarUser getOrCreate(UUID uuid, String name, Consumer<UUID> newPlayer, BiConsumer<String, String> nameUpdate) {
SteamwarUser user = SteamwarUser.get(uuid); SteamwarUser user = get(uuid);
if (user != null) { if (user != null) {
if (!user.userName.equals(name)) { if (!user.userName.equals(name)) {
@ -113,13 +114,13 @@ public class SteamwarUser {
nameUpdate.accept(user.userName, name); nameUpdate.accept(user.userName, name);
user.userName = name; user.userName = name;
} }
return user;
} else { } else {
insert.update(uuid, name); insert.update(uuid, name);
newPlayer.accept(uuid); newPlayer.accept(uuid);
return get(uuid); return get(uuid);
} }
return user;
} }
public static List<SteamwarUser> getServerTeam() { public static List<SteamwarUser> getServerTeam() {
@ -136,7 +137,7 @@ public class SteamwarUser {
return; return;
try (SelectStatement<SteamwarUser> batch = new SelectStatement<>(table, "SELECT * FROM UserData WHERE id IN (" + ids.stream().map(Object::toString).collect(Collectors.joining(", ")) + ")")) { try (SelectStatement<SteamwarUser> batch = new SelectStatement<>(table, "SELECT * FROM UserData WHERE id IN (" + ids.stream().map(Object::toString).collect(Collectors.joining(", ")) + ")")) {
batch.listSelect(); loadPunishments(batch.listSelect());
} }
} }