From a6488b3652fbf34e74e6dd9c0ba1ac53d47948ec Mon Sep 17 00:00:00 2001 From: Benedikt Constantin Radtke Date: Mon, 5 Dec 2016 22:13:33 +0100 Subject: [PATCH] fix zero length attachments crashing signal Fixes #5331 Closes #5926 --- src/org/thoughtcrime/securesms/jobs/PushSendJob.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/jobs/PushSendJob.java b/src/org/thoughtcrime/securesms/jobs/PushSendJob.java index 6f79d5f19a..ca23d0046e 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushSendJob.java @@ -63,7 +63,7 @@ public abstract class PushSendJob extends SendJob { ContentType.isVideoType(attachment.getContentType())) { try { - if (attachment.getDataUri() == null) throw new IOException("Assertion failed, outgoing attachment has no data!"); + if (attachment.getDataUri() == null || attachment.getSize() == 0) throw new IOException("Assertion failed, outgoing attachment has no data!"); InputStream is = PartAuthority.getAttachmentStream(context, masterSecret, attachment.getDataUri()); attachments.add(SignalServiceAttachment.newStreamBuilder() .withStream(is)