From b28c6c133649f776792d47a6ea3329bd80af193e Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Wed, 5 Oct 2016 22:36:40 +1300 Subject: [PATCH] Fix allerged null pointer exception --- .../libraryaddict/disguise/disguisetypes/MiscDisguise.java | 6 +++++- .../libraryaddict/disguise/disguisetypes/MobDisguise.java | 7 ++++++- .../disguise/disguisetypes/PlayerDisguise.java | 6 +++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/me/libraryaddict/disguise/disguisetypes/MiscDisguise.java b/src/me/libraryaddict/disguise/disguisetypes/MiscDisguise.java index 130afdf4..d472c777 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/MiscDisguise.java +++ b/src/me/libraryaddict/disguise/disguisetypes/MiscDisguise.java @@ -93,7 +93,11 @@ public class MiscDisguise extends TargetedDisguise disguise.setHideHeldItemFromSelf(isHidingHeldItemFromSelf()); disguise.setVelocitySent(isVelocitySent()); disguise.setModifyBoundingBox(isModifyBoundingBox()); - disguise.setWatcher(getWatcher().clone(disguise)); + + if (getWatcher() != null) + { + disguise.setWatcher(getWatcher().clone(disguise)); + } return disguise; } diff --git a/src/me/libraryaddict/disguise/disguisetypes/MobDisguise.java b/src/me/libraryaddict/disguise/disguisetypes/MobDisguise.java index 73fdc9b9..5b609495 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/MobDisguise.java +++ b/src/me/libraryaddict/disguise/disguisetypes/MobDisguise.java @@ -54,7 +54,12 @@ public class MobDisguise extends TargetedDisguise disguise.setHideHeldItemFromSelf(isHidingHeldItemFromSelf()); disguise.setVelocitySent(isVelocitySent()); disguise.setModifyBoundingBox(isModifyBoundingBox()); - disguise.setWatcher(getWatcher().clone(disguise)); + + if (getWatcher() != null) + { + disguise.setWatcher(getWatcher().clone(disguise)); + } + return disguise; } diff --git a/src/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java b/src/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java index c2c6bb21..57ae731f 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java +++ b/src/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java @@ -106,7 +106,11 @@ public class PlayerDisguise extends TargetedDisguise disguise.setHideHeldItemFromSelf(isHidingHeldItemFromSelf()); disguise.setVelocitySent(isVelocitySent()); disguise.setModifyBoundingBox(isModifyBoundingBox()); - disguise.setWatcher(getWatcher().clone(disguise)); + + if (getWatcher() != null) + { + disguise.setWatcher(getWatcher().clone(disguise)); + } disguise.createDisguise(DisguiseType.PLAYER);