mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-11-04 08:59:47 +01:00
Fix NullPointerException on load when using 1.11.x
This commit is contained in:
parent
2c3c8af932
commit
2ae5431142
@ -15,6 +15,7 @@ import org.bukkit.entity.Villager;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@ -237,7 +238,11 @@ public class ReflectionFlagWatchers {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Method[] getDisguiseWatcherMethods(Class<? extends FlagWatcher> watcherClass) {
|
public static Method[] getDisguiseWatcherMethods(@Nullable Class<? extends FlagWatcher> watcherClass) {
|
||||||
|
if (watcherClass == null) {
|
||||||
|
return new Method[0];
|
||||||
|
}
|
||||||
|
|
||||||
ArrayList<Method> methods = new ArrayList<>(Arrays.asList(watcherClass.getMethods()));
|
ArrayList<Method> methods = new ArrayList<>(Arrays.asList(watcherClass.getMethods()));
|
||||||
|
|
||||||
Iterator<Method> itel = methods.iterator();
|
Iterator<Method> itel = methods.iterator();
|
||||||
|
Loading…
Reference in New Issue
Block a user