Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d74ca5a9 authored by Michael W's avatar Michael W Committed by Arne Coucheron
Browse files

Gallery2: Fix potential crash

* A race between deleting and displaying videos seems to report a higher
  count of videos available than actually accessible.

BUGBASH-489

Change-Id: Iac24002feb8701cc4182c3834f663be017b625d5
parent 7e1b2d25
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -652,9 +652,14 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster
        if (mMediaSet == null)
            return false;
        int count = mMediaSet.getMediaItemCount();
        ArrayList<MediaItem> list;
        MediaItem item;
        for (int i = 0; i < count; i++) {
            item = mMediaSet.getMediaItem(i, 1).get(0);
            list = mMediaSet.getMediaItem(i, 1);
            if (list == null) {
                continue;
            }
            item = list.get(0);
            if (item == null) {
                continue;
            }