]> nmode's Git Repositories - signal-cli/commitdiff
Prevent NullPointerException when sending sync groups
authorAsamK <asamk@gmx.de>
Thu, 14 Jul 2016 14:07:34 +0000 (16:07 +0200)
committerAsamK <asamk@gmx.de>
Thu, 14 Jul 2016 14:07:34 +0000 (16:07 +0200)
ContentType was null, if it could not be determined

src/main/java/org/asamk/signal/Manager.java

index 2edeb921af0dbc69972b1def4d132ae623ea49bc..2ea9249ecd30db13ccf9f6d534a3eb2bfd79e2e6 100644 (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);
     }