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
commitbfc04b862a7b0c8d8ebca377eac6cb2a73fd64c2 (patch)
tree941e680a05cfb10007156d47e6314dc9cf59fcc0 /src
parenteea522754d385c30d1918ab27c52e09d631ac7be (diff)
downloadandroid_packages_apps_Snap-bfc04b862a7b0c8d8ebca377eac6cb2a73fd64c2.tar.gz
android_packages_apps_Snap-bfc04b862a7b0c8d8ebca377eac6cb2a73fd64c2.tar.bz2
android_packages_apps_Snap-bfc04b862a7b0c8d8ebca377eac6cb2a73fd64c2.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;
}
}