diff --git a/lib/src/main/java/net/tomatentum/marinara/registry/InteractionRegistry.java b/lib/src/main/java/net/tomatentum/marinara/registry/InteractionRegistry.java index c38da82..31e3ad1 100644 --- a/lib/src/main/java/net/tomatentum/marinara/registry/InteractionRegistry.java +++ b/lib/src/main/java/net/tomatentum/marinara/registry/InteractionRegistry.java @@ -3,7 +3,6 @@ package net.tomatentum.marinara.registry; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.Optional; import net.tomatentum.marinara.interaction.InteractionHandler; @@ -26,14 +25,15 @@ public class InteractionRegistry { public void addInteractions(InteractionHandler interactionHandler) { for (Method method : interactionHandler.getClass().getMethods()) { - interactionMethods.add(InteractionMethod.create(method, interactionHandler, wrapper)); + InteractionMethod iMethod = InteractionMethod.create(method, interactionHandler, wrapper); + if (iMethod != null) + this.interactionMethods.add(iMethod); } } public void registerCommands() { List defs = new ArrayList<>(); List execDefs = interactionMethods.stream() - .filter(Objects::nonNull) .filter((x) -> x.getClass().isAssignableFrom(SlashCommandInteractionMethod.class)) .map((x) -> ((SlashCommandInteractionMethod)x).getCommandDefinition()) .toList();