mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-17 13:08:25 +00:00
Merge pull request #606 from Brice-W/fix-illegalstateexception
Fix IllegalStateException
This commit is contained in:
commit
ac4b576abe
@ -28,7 +28,7 @@ public class MediaPreviewViewModel extends ViewModel {
|
|||||||
|
|
||||||
public void setCursor(@NonNull Context context, @Nullable Cursor cursor, boolean leftIsRecent) {
|
public void setCursor(@NonNull Context context, @Nullable Cursor cursor, boolean leftIsRecent) {
|
||||||
boolean firstLoad = (this.cursor == null) && (cursor != null);
|
boolean firstLoad = (this.cursor == null) && (cursor != null);
|
||||||
if (this.cursor != null) {
|
if (this.cursor != null && !this.cursor.equals(cursor)) {
|
||||||
this.cursor.close();
|
this.cursor.close();
|
||||||
}
|
}
|
||||||
this.cursor = cursor;
|
this.cursor = cursor;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user