Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
fix npe
Browse files Browse the repository at this point in the history
  • Loading branch information
Librazy committed Dec 24, 2018
1 parent 4cb30ac commit ba06fd9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/cat/nyaa/nyaautils/sit/SitListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,11 @@ public void onPlayerDeath(PlayerDeathEvent event) {
@EventHandler
public void onQuit(PlayerQuitEvent event) {
Player player = event.getPlayer();
if (safeLocations.containsKey(player.getUniqueId()) && player.isInsideVehicle() && player.getVehicle() instanceof ArmorStand) {
Entity vehicle = player.getVehicle();
if (safeLocations.containsKey(player.getUniqueId()) && player.isInsideVehicle() && vehicle instanceof ArmorStand) {
safeLocations.remove(player.getUniqueId());
player.leaveVehicle();
player.getVehicle().remove();
vehicle.remove();
}
}
}

0 comments on commit ba06fd9

Please sign in to comment.