prevent NPE VAvatar.java

This commit is contained in:
kevlahnota
2025-10-04 07:50:11 +08:00
committed by GitHub
parent 4ab8c1414c
commit a2b324c9ce

View File

@@ -124,7 +124,7 @@ public class VAvatar extends FDisplayObject {
float w = isHovered() ? getWidth()/16f+getWidth() : getWidth(); float w = isHovered() ? getWidth()/16f+getWidth() : getWidth();
float h = isHovered() ? getWidth()/16f+getHeight() : getHeight(); float h = isHovered() ? getWidth()/16f+getHeight() : getHeight();
if (avatarAnimation != null && !MatchController.instance.getGameView().isMatchOver()) { if (avatarAnimation != null && MatchController.instance.getGameView() != null && !MatchController.instance.getGameView().isMatchOver()) {
if (player.wasAvatarLifeChanged()) { if (player.wasAvatarLifeChanged()) {
avatarAnimation.start(); avatarAnimation.start();
avatarAnimation.drawAvatar(g, image, 0, 0, w, h); avatarAnimation.drawAvatar(g, image, 0, 0, w, h);