From bfc04b862a7b0c8d8ebca377eac6cb2a73fd64c2 Mon Sep 17 00:00:00 2001 From: Chih-Chung Chang Date: Wed, 1 Aug 2012 14:43:35 +0800 Subject: Handle null item in findIndexOfPathInCache. Bug: 6708911 Change-Id: Ifd1e8342906a3c61d30448ea6b0085c37ccdeb03 --- src/com/android/gallery3d/app/PhotoDataAdapter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/android/gallery3d/app/PhotoDataAdapter.java b/src/com/android/gallery3d/app/PhotoDataAdapter.java index 1e8df24e6..ae01dd9ec 100644 --- a/src/com/android/gallery3d/app/PhotoDataAdapter.java +++ b/src/com/android/gallery3d/app/PhotoDataAdapter.java @@ -1077,7 +1077,8 @@ public class PhotoDataAdapter implements PhotoPage.Model { private int findIndexOfPathInCache(UpdateInfo info, Path path) { ArrayList items = info.items; for (int i = 0, n = items.size(); i < n; ++i) { - if (items.get(i).getPath() == path) { + MediaItem item = items.get(i); + if (item != null && item.getPath() == path) { return i + info.contentStart; } } -- cgit v1.2.3