Reply to un-downloaded image, we may not have cids

(cherry picked from commit 69d556e252edac724108ffeb189068cf25c87125)
This commit is contained in:
Stephen Paul Weber 2024-06-09 21:51:13 -05:00 committed by Arne
parent b6dcca4eba
commit eadf37fbfa

View file

@ -1178,8 +1178,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);