From 9af804ec2101344950ff3b162d4cde358cf95859 Mon Sep 17 00:00:00 2001 From: Brice-W Date: Wed, 16 Jun 2021 16:43:33 +1000 Subject: [PATCH] don't close the cursor if it's the same that is in the parameters --- .../securesms/mediapreview/MediaPreviewViewModel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/mediapreview/MediaPreviewViewModel.java b/app/src/main/java/org/thoughtcrime/securesms/mediapreview/MediaPreviewViewModel.java index 259579a59c..91dad13848 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/mediapreview/MediaPreviewViewModel.java +++ b/app/src/main/java/org/thoughtcrime/securesms/mediapreview/MediaPreviewViewModel.java @@ -28,7 +28,7 @@ public class MediaPreviewViewModel extends ViewModel { public void setCursor(@NonNull Context context, @Nullable Cursor cursor, boolean leftIsRecent) { boolean firstLoad = (this.cursor == null) && (cursor != null); - if (this.cursor != null) { + if (this.cursor != null && !this.cursor.equals(cursor)) { this.cursor.close(); } this.cursor = cursor;