[AB-93] fixing not initializing the attached files

This commit is contained in:
Sheldan
2023-05-18 23:43:34 +02:00
parent 8a41f366ae
commit 080733957f
2 changed files with 4 additions and 3 deletions

View File

@@ -342,7 +342,7 @@ public class ChannelServiceBean implements ChannelService {
throw new IllegalArgumentException("Message to send did not contain anything to send."); throw new IllegalArgumentException("Message to send did not contain anything to send.");
} }
} }
if(messageToSend.getAttachedFiles() != null && !messageToSend.getAttachedFiles().isEmpty()) { if(!messageToSend.getAttachedFiles().isEmpty()) {
List<FileUpload> files = messageToSend List<FileUpload> files = messageToSend
.getAttachedFiles() .getAttachedFiles()
.stream() .stream()

View File

@@ -32,7 +32,8 @@ public class MessageToSend {
/** /**
* The file handle to send attached to the message. * The file handle to send attached to the message.
*/ */
private List<AttachedFile> attachedFiles; @Builder.Default
private List<AttachedFile> attachedFiles = new ArrayList<>();
private MessageConfig messageConfig; private MessageConfig messageConfig;
private Long referencedMessageId; private Long referencedMessageId;
@Builder.Default @Builder.Default
@@ -44,7 +45,7 @@ public class MessageToSend {
private Boolean ephemeral = false; private Boolean ephemeral = false;
public boolean hasFilesToSend() { public boolean hasFilesToSend() {
return attachedFiles != null && !attachedFiles.isEmpty(); return !attachedFiles.isEmpty();
} }
@Getter @Getter