mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Prevent NullPointerException when sending sync groups
ContentType was null, if it could not be determined
This commit is contained in:
parent
c0a0f89896
commit
9f075da269
1 changed files with 3 additions and 0 deletions
|
@ -464,6 +464,9 @@ class Manager implements Signal {
|
||||||
InputStream attachmentStream = new FileInputStream(attachmentFile);
|
InputStream attachmentStream = new FileInputStream(attachmentFile);
|
||||||
final long attachmentSize = attachmentFile.length();
|
final long attachmentSize = attachmentFile.length();
|
||||||
String mime = Files.probeContentType(attachmentFile.toPath());
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue