From 43f3494073405eff7339d32e7c13a595ece5eb5b Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Thu, 1 Jun 2023 20:00:17 -0400 Subject: [PATCH] Check for an invalid avatar in a team --- .../java/emu/grasscutter/game/player/TeamInfo.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/player/TeamInfo.java b/src/main/java/emu/grasscutter/game/player/TeamInfo.java index fad4ee4c6..516abe766 100644 --- a/src/main/java/emu/grasscutter/game/player/TeamInfo.java +++ b/src/main/java/emu/grasscutter/game/player/TeamInfo.java @@ -1,12 +1,12 @@ package emu.grasscutter.game.player; -import static emu.grasscutter.config.Configuration.GAME_OPTIONS; - import dev.morphia.annotations.Entity; import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.net.proto.AvatarTeamOuterClass.AvatarTeam; -import java.util.ArrayList; -import java.util.List; + +import java.util.*; + +import static emu.grasscutter.config.Configuration.GAME_OPTIONS; @Entity public final class TeamInfo { @@ -87,6 +87,8 @@ public final class TeamInfo { for (int i = 0; i < this.getAvatars().size(); i++) { Avatar avatar = player.getAvatars().getAvatarById(this.getAvatars().get(i)); + if (avatar == null) continue; + avatarTeam.addAvatarGuidList(avatar.getGuid()); }