summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2012-08-01 14:43:35 +0800
committerChih-Chung Chang <chihchung@google.com>2012-08-01 14:43:35 +0800
commit0086dbabb383a9ba5e06a8b49e3e180bfa36a64b (patch)
tree51198865b8019fd6e3290ca0742ce3f0079c8ccf /src
parentabf0ea68634c1d21870c48297ab6898491e0c56f (diff)
downloadandroid_packages_apps_Gallery2-0086dbabb383a9ba5e06a8b49e3e180bfa36a64b.tar.gz
android_packages_apps_Gallery2-0086dbabb383a9ba5e06a8b49e3e180bfa36a64b.tar.bz2
android_packages_apps_Gallery2-0086dbabb383a9ba5e06a8b49e3e180bfa36a64b.zip
Handle null item in findIndexOfPathInCache.
Bug: 6708911 Change-Id: Ifd1e8342906a3c61d30448ea6b0085c37ccdeb03
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/app/PhotoDataAdapter.java3
1 files changed, 2 insertions, 1 deletions
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<MediaItem> 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;
}
}