From 4fbe2deffc94d087d123dd2b74cd54e1f3558216 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 12 Aug 2022 10:22:45 +0200 Subject: [PATCH] skip empty uris on attach --- src/main/java/eu/siacs/conversations/ui/util/Attachment.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/ui/util/Attachment.java b/src/main/java/eu/siacs/conversations/ui/util/Attachment.java index f994955d0..9c6849ce6 100644 --- a/src/main/java/eu/siacs/conversations/ui/util/Attachment.java +++ b/src/main/java/eu/siacs/conversations/ui/util/Attachment.java @@ -139,6 +139,9 @@ public class Attachment implements Parcelable { public static List of(final Context context, List uris, final String type) { final List attachments = new ArrayList<>(); for (final Uri uri : uris) { + if (uri == null) { + continue; + } final String mime = MimeUtils.guessMimeTypeFromUriAndMime(context, uri, type); attachments.add(new Attachment(uri, mime != null && isImage(mime) ? Type.IMAGE : Type.FILE, mime)); }