Abort story send if any of the messages do not have an attachment.

This commit is contained in:
Alex Hart 2022-07-06 12:09:16 -03:00
parent c906abdb37
commit 5b781c45f3

View file

@ -197,8 +197,13 @@ public class MessageSender {
List<UploadDependencyGraph.Node> nodes = dependencyGraph.getDependencyMap().get(message);
if (nodes == null || nodes.isEmpty()) {
Log.d(TAG, "No attachments for given message. Skipping.");
if (message.getStoryType().isTextStory()) {
Log.d(TAG, "No attachments for given text story. Skipping.");
continue;
} else {
Log.e(TAG, "No attachments for given media story. Aborting.");
throw new MmsException("No attachment for story.");
}
}
List<AttachmentId> attachmentIds = nodes.stream().map(UploadDependencyGraph.Node::getAttachmentId).collect(Collectors.toList());