From 69d556e252edac724108ffeb189068cf25c87125 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Sun, 9 Jun 2024 21:51:13 -0500 Subject: [PATCH] Reply to un-downloaded image, we may not have cids --- src/main/java/eu/siacs/conversations/entities/Message.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index eeae64e8983e0ff2aafa22c4d5b16c3622e39b24..fa8f7f809c9f6bf004ac3b4f959a99a0fd78efc8 100644 --- a/src/main/java/eu/siacs/conversations/entities/Message.java +++ b/src/main/java/eu/siacs/conversations/entities/Message.java @@ -1117,8 +1117,8 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable final var quote = getInReplyTo().getSpannableBody(thumbnailer, fallbackImg); if ((getInReplyTo().isFileOrImage() || getInReplyTo().isOOb()) && getInReplyTo().getFileParams() != null) { quote.insert(0, "🖼️"); - final var cid = getInReplyTo().getFileParams().getCids().get(0); - Drawable thumbnail = thumbnailer == null ? null : thumbnailer.getThumbnail(cid); + final var cid = getInReplyTo().getFileParams().getCids().size() < 1 ? null : getInReplyTo().getFileParams().getCids().get(0); + Drawable thumbnail = thumbnailer == null || cid == null ? null : thumbnailer.getThumbnail(cid); if (thumbnail == null) thumbnail = fallbackImg; if (thumbnail != null) { quote.setSpan(new InlineImageSpan(thumbnail, cid.toString()), 0, 2, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);