diff --git a/common/src/main/java/io/github/fisher2911/hmccosmetics/user/Wardrobe.java b/common/src/main/java/io/github/fisher2911/hmccosmetics/user/Wardrobe.java index d42b4169..dba09f2d 100644 --- a/common/src/main/java/io/github/fisher2911/hmccosmetics/user/Wardrobe.java +++ b/common/src/main/java/io/github/fisher2911/hmccosmetics/user/Wardrobe.java @@ -136,7 +136,10 @@ public class Wardrobe extends User { this.cameraLocked = false; this.currentLocation = null; this.getPlayerArmor().clear(); - Bukkit.getScheduler().runTask(this.plugin, () -> viewer.teleport(settings.getLeaveLocation())); + Bukkit.getScheduler().runTask(this.plugin, () -> { + if (viewer == null || !viewer.isOnline()) return; + viewer.teleport(settings.getLeaveLocation()); + }); if (settings.isAlwaysDisplay()) { this.currentLocation = settings.getWardrobeLocation();