From 2ae5431142d54c1d53155dcc273feaef7cd2a39e Mon Sep 17 00:00:00 2001 From: Jacob Martin Date: Sun, 9 Jul 2017 14:39:37 -0500 Subject: [PATCH] Fix NullPointerException on load when using 1.11.x --- .../disguise/utilities/ReflectionFlagWatchers.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/me/libraryaddict/disguise/utilities/ReflectionFlagWatchers.java b/src/me/libraryaddict/disguise/utilities/ReflectionFlagWatchers.java index f1b2410a..5f29aeee 100644 --- a/src/me/libraryaddict/disguise/utilities/ReflectionFlagWatchers.java +++ b/src/me/libraryaddict/disguise/utilities/ReflectionFlagWatchers.java @@ -15,6 +15,7 @@ import org.bukkit.entity.Villager; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; +import javax.annotation.Nullable; import java.lang.reflect.Method; import java.util.*; @@ -237,7 +238,11 @@ public class ReflectionFlagWatchers { }); } - public static Method[] getDisguiseWatcherMethods(Class watcherClass) { + public static Method[] getDisguiseWatcherMethods(@Nullable Class watcherClass) { + if (watcherClass == null) { + return new Method[0]; + } + ArrayList methods = new ArrayList<>(Arrays.asList(watcherClass.getMethods())); Iterator itel = methods.iterator();