summaryrefslogtreecommitdiffstats
path: root/photoviewer
diff options
context:
space:
mode:
authorMark Wei <markwei@google.com>2012-09-17 11:16:42 -0700
committerMark Wei <markwei@google.com>2012-09-17 12:14:58 -0700
commit697c046e3f0632f698d269423b62bb53a7d37a32 (patch)
tree12d9e1d16123956b2f321820dedbbb1430edb0cc /photoviewer
parent6c66847624945b3caca9607c61669f4766e7f39e (diff)
downloadandroid_frameworks_ex-697c046e3f0632f698d269423b62bb53a7d37a32.tar.gz
android_frameworks_ex-697c046e3f0632f698d269423b62bb53a7d37a32.tar.bz2
android_frameworks_ex-697c046e3f0632f698d269423b62bb53a7d37a32.zip
Prevent NPE in Gmail while viewing photo from attachment
Bug: 7174197 Change-Id: I29ca226b5134888dbe3488f859d9790fe1388984
Diffstat (limited to 'photoviewer')
-rw-r--r--photoviewer/src/com/android/ex/photo/fragments/PhotoViewFragment.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/photoviewer/src/com/android/ex/photo/fragments/PhotoViewFragment.java b/photoviewer/src/com/android/ex/photo/fragments/PhotoViewFragment.java
index 97ea3b8..4e6296b 100644
--- a/photoviewer/src/com/android/ex/photo/fragments/PhotoViewFragment.java
+++ b/photoviewer/src/com/android/ex/photo/fragments/PhotoViewFragment.java
@@ -166,7 +166,10 @@ public class PhotoViewFragment extends Fragment implements
super.onCreate(savedInstanceState);
if (savedInstanceState != null) {
- mIntent = new Intent().putExtras(savedInstanceState.getBundle(STATE_INTENT_KEY));
+ final Bundle state = savedInstanceState.getBundle(STATE_INTENT_KEY);
+ if (state != null) {
+ mIntent = new Intent().putExtras(state);
+ }
}
mResolvedPhotoUri = mIntent.getStringExtra(Intents.EXTRA_RESOLVED_PHOTO_URI);