Fix null disguises error

This commit is contained in:
libraryaddict 2020-06-16 11:17:18 +12:00 committed by GitHub
parent 3a85aa29a0
commit 1a659f8b09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -589,7 +589,7 @@ public class DisguiseListener implements Listener {
if (viewSelfToggled) { if (viewSelfToggled) {
final Disguise disguise = DisguiseAPI.getDisguise(event.getPlayer()); final Disguise disguise = DisguiseAPI.getDisguise(event.getPlayer());
if (disguise.isSelfDisguiseVisible()) { if (disguise != null && disguise.isSelfDisguiseVisible()) {
disguise.setViewSelfDisguise(false); disguise.setViewSelfDisguise(false);
Bukkit.getScheduler().runTaskLater(plugin, () -> disguise.setViewSelfDisguise(true), 20L); Bukkit.getScheduler().runTaskLater(plugin, () -> disguise.setViewSelfDisguise(true), 20L);
@ -660,7 +660,7 @@ public class DisguiseListener implements Listener {
if (viewSelfToggled) { if (viewSelfToggled) {
final Disguise disguise = DisguiseAPI.getDisguise(event.getPlayer()); final Disguise disguise = DisguiseAPI.getDisguise(event.getPlayer());
if (disguise.isSelfDisguiseVisible()) { if (disguise != null && disguise.isSelfDisguiseVisible()) {
disguise.setViewSelfDisguise(false); disguise.setViewSelfDisguise(false);
Bukkit.getScheduler().runTaskLater(plugin, () -> disguise.setViewSelfDisguise(true), 20L); Bukkit.getScheduler().runTaskLater(plugin, () -> disguise.setViewSelfDisguise(true), 20L);