diff options
author | Bobby Georgescu <georgescu@google.com> | 2012-10-10 22:04:54 -0700 |
---|---|---|
committer | Bobby Georgescu <georgescu@google.com> | 2012-10-10 22:04:54 -0700 |
commit | 4efd36382462f902e916d89da461ec15eac5fe52 (patch) | |
tree | dca24e3c2527c50a69a568a2fb6624c69b307382 | |
parent | 96442bc44c18160583867ad464509c74644a927a (diff) | |
download | android_packages_apps_Snap-4efd36382462f902e916d89da461ec15eac5fe52.tar.gz android_packages_apps_Snap-4efd36382462f902e916d89da461ec15eac5fe52.tar.bz2 android_packages_apps_Snap-4efd36382462f902e916d89da461ec15eac5fe52.zip |
Fix NPE in PhotoPage.updateMenuOperations
Bug: 7324012
Change-Id: If09d20b7ab64abe9020f7f6301356ed9a4155d5b
-rw-r--r-- | src/com/android/gallery3d/app/PhotoPage.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index f6e3fb745..792ac0c64 100644 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -726,14 +726,18 @@ public class PhotoPage extends ActivityState implements if ((supportedOperations & MediaObject.SUPPORT_PANORAMA360) != 0) { mActivity.invalidateOptionsMenu(); item = menu.findItem(R.id.action_share); - item.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); - item.setTitle( - mActivity.getResources().getString(R.string.share_as_photo)); + if (item != null) { + item.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); + item.setTitle( + mActivity.getResources().getString(R.string.share_as_photo)); + } } else if ((supportedOperations & MediaObject.SUPPORT_SHARE) != 0) { item = menu.findItem(R.id.action_share); - item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); - item.setTitle( - mActivity.getResources().getString(R.string.share)); + if (item != null) { + item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM); + item.setTitle( + mActivity.getResources().getString(R.string.share)); + } } } |