ContentType was null, if it could not be determined
InputStream attachmentStream = new FileInputStream(attachmentFile);
final long attachmentSize = attachmentFile.length();
String mime = Files.probeContentType(attachmentFile.toPath());
InputStream attachmentStream = new FileInputStream(attachmentFile);
final long attachmentSize = attachmentFile.length();
String mime = Files.probeContentType(attachmentFile.toPath());
+ if (mime == null) {
+ mime = "application/octet-stream";
+ }
return new SignalServiceAttachmentStream(attachmentStream, mime, attachmentSize, null);
}
return new SignalServiceAttachmentStream(attachmentStream, mime, attachmentSize, null);
}