fix potential NPE

This commit is contained in:
Mark committed 2026-02-01 01:11:08 +03:00
1 parent 17d8c99e8b
commit 3d789cdf3a
2 files changed
+2 -2

No files matched your search

@@ -62,7 +62,7 @@ public class EntityCustomNpc extends EntityNPCFlying {
@Override
public void updateHitbox() {
Entity entity = modelData.getEntity(this);
if (modelData == null || entity == null) {
if (entity == null) {
baseHeight = 1.9f - modelData.getBodyY() + (modelData.modelScale.head.scaleY - 1) / 2;
super.updateHitbox();
} else {
@@ -328,7 +328,7 @@ public class RoleCompanion extends RoleInterface {
((CompanionTrader) jobInterface).interact(player);
if (player != owner || !npc.isEntityAlive() || npc.isAttacking())
return;
if (player.isSneaking()) {
if (player != null && player.isSneaking()) {
openGui(player);
} else {
setSitting(!isSitting());