Prevent NullPointerException when sending sync groups

ContentType was null, if it could not be determined
This commit is contained in:
AsamK 2016-07-14 16:07:34 +02:00
parent c0a0f89896
commit 9f075da269

View file

@ -464,6 +464,9 @@ class Manager implements Signal {
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);
}