From 35cd1b7b3e5e99899a980f3abfc5602cbbd8a377 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 4 Mar 2025 15:37:33 +0100 Subject: [PATCH] Fix a crash --- .../app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java index 42f1e0ff..cec172e1 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java @@ -3406,7 +3406,7 @@ public class StatusAdapter extends RecyclerView.Adapter }); } ConstraintLayout.LayoutParams lp; - if(status.media_attachments.get(0).meta != null && status.media_attachments.get(0).meta.getSmall() != null) { + if(!status.media_attachments.isEmpty() && status.media_attachments.get(0).meta != null && status.media_attachments.get(0).meta.getSmall() != null) { float mediaH = status.media_attachments.get(0).meta.getSmall().height; float mediaW = status.media_attachments.get(0).meta.getSmall().width; float ratio = measuredWidthArt > 0 ? measuredWidthArt / mediaW : 1.0f;