diff --git a/src/main/java/net/dv8tion/jda/internal/interactions/component/EntitySelectInteractionImpl.java b/src/main/java/net/dv8tion/jda/internal/interactions/component/EntitySelectInteractionImpl.java index e736781ece..c46a9f3e9f 100644 --- a/src/main/java/net/dv8tion/jda/internal/interactions/component/EntitySelectInteractionImpl.java +++ b/src/main/java/net/dv8tion/jda/internal/interactions/component/EntitySelectInteractionImpl.java @@ -20,6 +20,7 @@ import net.dv8tion.jda.api.entities.Mentions; import net.dv8tion.jda.api.interactions.components.selections.EntitySelectInteraction; import net.dv8tion.jda.api.interactions.components.selections.EntitySelectMenu; +import net.dv8tion.jda.api.utils.data.DataArray; import net.dv8tion.jda.api.utils.data.DataObject; import net.dv8tion.jda.internal.JDAImpl; import net.dv8tion.jda.internal.entities.GuildImpl; @@ -39,8 +40,8 @@ public EntitySelectInteractionImpl(JDAImpl jda, DataObject data) this.mentions = new SelectMenuMentions( jda, (GuildImpl) getGuild(), - content.getObject("resolved"), - content.getArray("values") + content.optObject("resolved").orElseGet(DataObject::empty), + content.optArray("values").orElseGet(DataArray::empty) ); } diff --git a/src/main/java/net/dv8tion/jda/internal/interactions/component/StringSelectInteractionImpl.java b/src/main/java/net/dv8tion/jda/internal/interactions/component/StringSelectInteractionImpl.java index 5e17e170eb..142f89d998 100644 --- a/src/main/java/net/dv8tion/jda/internal/interactions/component/StringSelectInteractionImpl.java +++ b/src/main/java/net/dv8tion/jda/internal/interactions/component/StringSelectInteractionImpl.java @@ -39,9 +39,10 @@ public StringSelectInteractionImpl(JDAImpl jda, DataObject data) protected List parseValues(DataObject data) { - return data.getArray("values") - .stream(DataArray::getString) - .collect(Collectors.toList()); + return data.optArray("values").map(arr -> + arr.stream(DataArray::getString) + .collect(Collectors.toList()) + ).orElse(Collections.emptyList()); } @Nonnull