diff --git a/src/main/java/emu/grasscutter/game/talk/TalkManager.java b/src/main/java/emu/grasscutter/game/talk/TalkManager.java index 8a613834c..55c464ebe 100644 --- a/src/main/java/emu/grasscutter/game/talk/TalkManager.java +++ b/src/main/java/emu/grasscutter/game/talk/TalkManager.java @@ -28,18 +28,18 @@ public final class TalkManager extends BasePlayerManager { var player = this.getPlayer(); // Check if the NPC id is valid. var entity = player.getScene().getEntityById(npcEntityId); - if (entity == null) return; - - // The config ID of the entity is the NPC's ID. - if (!talkData.getNpcId().contains(entity.getConfigId())) - return; + if (entity != null) { + // The config ID of the entity is the NPC's ID. + if (!talkData.getNpcId().contains(entity.getConfigId())) + return; + } // Execute the talk action on associated handlers. talkData .getFinishExec() .forEach( e -> - this.getPlayer().getServer().getTalkSystem().triggerExec(getPlayer(), talkData, e)); + player.getServer().getTalkSystem().triggerExec(player, talkData, e)); // Invoke the talking events for quests. var questManager = player.getQuestManager();