Skip to content

Commit

Permalink
Merge pull request #1000 from ImYenil/Fix-NPCRemoveEvent-NullPointerE…
Browse files Browse the repository at this point in the history
…xception-

Fixed NullPointerException error in NPCRemoveEvent event
  • Loading branch information
andrei1058 authored Apr 20, 2024
2 parents 3895fd0 + 1f5a2ff commit 89129b2
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public class CitizensListener implements Listener {
@EventHandler
public void removeNPC(NPCRemoveEvent e) {
if (e == null) return;
if (e.getNPC() == null) return;
if (e.getNPC().getEntity() == null) return;
List<String> locations = BedWars.config.getYml().getStringList(ConfigPath.GENERAL_CONFIGURATION_NPC_LOC_STORAGE);
boolean removed = false;
if (JoinNPC.npcs.containsKey(e.getNPC().getId())) {
Expand Down

0 comments on commit 89129b2

Please sign in to comment.