summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2012-08-01 00:19:27 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-08-01 00:19:28 -0700
commit6608d900c702972a19e0f9e8526add7a8b522fd3 (patch)
treeeaec07b28f806b89681d8c81eaf652a72255955e /src
parentfb5571987f2555b04731b6f3e1c479efc16d542a (diff)
parent0086dbabb383a9ba5e06a8b49e3e180bfa36a64b (diff)
downloadandroid_packages_apps_Gallery2-6608d900c702972a19e0f9e8526add7a8b522fd3.tar.gz
android_packages_apps_Gallery2-6608d900c702972a19e0f9e8526add7a8b522fd3.tar.bz2
android_packages_apps_Gallery2-6608d900c702972a19e0f9e8526add7a8b522fd3.zip
Merge "Handle null item in findIndexOfPathInCache." into gb-ub-photos-arches
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;
}
}