diff options
author | Chih-Chung Chang <chihchung@google.com> | 2009-10-19 16:12:42 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2009-10-19 16:12:42 +0800 |
commit | 95bd9eb09f84c4344a688fe32c727bc005f16c6c (patch) | |
tree | c3cf372dc0799edc78768d47d00f879c82e2bf3a /src | |
parent | 4916316bb9a2196cbf6cc63e531c0ce6786ed56a (diff) | |
download | LegacyCamera-95bd9eb09f84c4344a688fe32c727bc005f16c6c.tar.gz LegacyCamera-95bd9eb09f84c4344a688fe32c727bc005f16c6c.tar.bz2 LegacyCamera-95bd9eb09f84c4344a688fe32c727bc005f16c6c.zip |
Fix 2186855: NPE in ViewImage.setImage.
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/ViewImage.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/camera/ViewImage.java b/src/com/android/camera/ViewImage.java index ec5655a3..7a334117 100644 --- a/src/com/android/camera/ViewImage.java +++ b/src/com/android/camera/ViewImage.java @@ -404,8 +404,12 @@ public class ViewImage extends NoSearchActivity implements View.OnClickListener Uri uri = image.fullSizeImageUri(); cb.run(uri, image); - mImageView.clear(); - setImage(mCurrentPosition, false); + // We might have deleted all images in the callback, so + // call setImage() only if we still have some images. + if (mAllImages.getCount() > 0) { + mImageView.clear(); + setImage(mCurrentPosition, false); + } } }); |