summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-06-08 11:31:44 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-06-08 11:31:44 -0700
commit43989f8a9bd6d2416f30cdcfdcc18f2d934353ea (patch)
tree6fabf6334f25d8ab8d55d69f22657ab3c03702e5 /src/com/android/gallery3d/app
parentdae1380855e6e4598a6e1ea02f9ed5c0dc770602 (diff)
parent80a22b3cfd516a8cd8981971bceb850854d4de8d (diff)
downloadandroid_packages_apps_Gallery2-43989f8a9bd6d2416f30cdcfdcc18f2d934353ea.tar.gz
android_packages_apps_Gallery2-43989f8a9bd6d2416f30cdcfdcc18f2d934353ea.tar.bz2
android_packages_apps_Gallery2-43989f8a9bd6d2416f30cdcfdcc18f2d934353ea.zip
Merge "Fix NullPointerException crash when save state in photopage"
Diffstat (limited to 'src/com/android/gallery3d/app')
-rwxr-xr-xsrc/com/android/gallery3d/app/PhotoPage.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index a33f9d621..910500157 100755
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -631,9 +631,13 @@ public abstract class PhotoPage extends ActivityState implements
@Override
protected void onSaveState(Bundle outState) {
- outState.putInt(KEY_INDEX_HINT,mCurrentIndex);
- outState.putString(KEY_CURRENT_PHOTO_HINT, mCurrentPhoto.getFilePath());
- super.onSaveState(outState);
+ if (mCurrentPhoto != null) {
+ outState.putInt(KEY_INDEX_HINT,mCurrentIndex);
+ outState.putString(KEY_CURRENT_PHOTO_HINT, mCurrentPhoto.getFilePath());
+ super.onSaveState(outState);
+ } else {
+ onBackPressed();
+ }
}
@Override