We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ModalMapping::getAsAttachmentList
1 parent fc4d1ef commit 726ef9dCopy full SHA for 726ef9d
src/main/java/net/dv8tion/jda/api/interactions/modals/ModalMapping.java
@@ -29,6 +29,7 @@
29
import net.dv8tion.jda.internal.utils.Helpers;
30
31
import javax.annotation.Nonnull;
32
+import java.util.Collections;
33
import java.util.List;
34
import java.util.Objects;
35
@@ -203,6 +204,9 @@ public List<Message.Attachment> getAsAttachmentList()
203
204
if (type != Component.Type.FILE_UPLOAD)
205
typeError("List<Message.Attachment>");
206
207
+ if (resolved.isNull("attachments"))
208
+ return Collections.emptyList();
209
+
210
final DataObject attachments = resolved.getObject("attachments");
211
final EntityBuilder entityBuilder = interaction.getJDA().getEntityBuilder();
212
return value.getArray("values")
0 commit comments