From 1a659f8b09dfb43095c5c53a030a9004efd9ad5d Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Tue, 16 Jun 2020 11:17:18 +1200 Subject: [PATCH] Fix null disguises error --- .../disguise/utilities/listeners/DisguiseListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java b/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java index 27d0b7ef..21b4168d 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java @@ -589,7 +589,7 @@ public class DisguiseListener implements Listener { if (viewSelfToggled) { final Disguise disguise = DisguiseAPI.getDisguise(event.getPlayer()); - if (disguise.isSelfDisguiseVisible()) { + if (disguise != null && disguise.isSelfDisguiseVisible()) { disguise.setViewSelfDisguise(false); Bukkit.getScheduler().runTaskLater(plugin, () -> disguise.setViewSelfDisguise(true), 20L); @@ -660,7 +660,7 @@ public class DisguiseListener implements Listener { if (viewSelfToggled) { final Disguise disguise = DisguiseAPI.getDisguise(event.getPlayer()); - if (disguise.isSelfDisguiseVisible()) { + if (disguise != null && disguise.isSelfDisguiseVisible()) { disguise.setViewSelfDisguise(false); Bukkit.getScheduler().runTaskLater(plugin, () -> disguise.setViewSelfDisguise(true), 20L);