fix zero length attachments crashing signal

Fixes #5331
Closes #5926
pull/1/head
Benedikt Constantin Radtke 8 years ago committed by Moxie Marlinspike
parent cde92256a6
commit a6488b3652

@ -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)

Loading…
Cancel
Save