From 9f150391888af2cc2299fc9bc73b3448911cf91a Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 14 May 2024 15:25:45 +0930 Subject: [PATCH] Add more info to unselect exception --- .../org/thoughtcrime/securesms/MediaPreviewActivity.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/MediaPreviewActivity.java b/app/src/main/java/org/thoughtcrime/securesms/MediaPreviewActivity.java index 7e4f3a4e01..2e67becbfd 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/MediaPreviewActivity.java +++ b/app/src/main/java/org/thoughtcrime/securesms/MediaPreviewActivity.java @@ -565,8 +565,12 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im public void onPageUnselected(int position) { if (adapter == null) return; - MediaItem item = adapter.getMediaItemFor(position); - if (item.recipient != null) item.recipient.removeListener(MediaPreviewActivity.this); + try { + MediaItem item = adapter.getMediaItemFor(position); + if (item.recipient != null) item.recipient.removeListener(MediaPreviewActivity.this); + } catch (CursorIndexOutOfBoundsException e) { + throw new RuntimeException("position = " + position + " leftIsRecent = " + leftIsRecent, e); + } adapter.pause(position); }