summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2012-08-17 15:28:22 +0800
committerOwen Lin <owenlin@google.com>2012-08-17 15:28:22 +0800
commit82cdb7bf23b0a9f2f26acd141dce7012bd8c70d5 (patch)
tree7dba6785350da65445ec1e085d11175290911b25
parentb195696d6d721084128784c630a410256bfd3a42 (diff)
downloadandroid_packages_apps_Snap-82cdb7bf23b0a9f2f26acd141dce7012bd8c70d5.tar.gz
android_packages_apps_Snap-82cdb7bf23b0a9f2f26acd141dce7012bd8c70d5.tar.bz2
android_packages_apps_Snap-82cdb7bf23b0a9f2f26acd141dce7012bd8c70d5.zip
Fix NPE when view a single photo.
bug: 6995776 Change-Id: Iba213dfefcab04f2c856f55dc3446e3314f30a6f
-rw-r--r--src/com/android/gallery3d/actionbar/SystemActionBarWrapper.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/actionbar/SystemActionBarWrapper.java b/src/com/android/gallery3d/actionbar/SystemActionBarWrapper.java
index 3c4dac5ae..2d70aa609 100644
--- a/src/com/android/gallery3d/actionbar/SystemActionBarWrapper.java
+++ b/src/com/android/gallery3d/actionbar/SystemActionBarWrapper.java
@@ -169,18 +169,21 @@ public class SystemActionBarWrapper implements ActionBarInterface {
@Override
public void setMenuItemVisible(int menuItemId, boolean visible) {
+ if (mMenu == null) return;
MenuItem item = mMenu.findItem(menuItemId);
if (item != null) item.setVisible(visible);
}
@Override
public void setMenuItemTitle(int menuItemId, String title) {
+ if (mMenu == null) return;
MenuItem item = mMenu.findItem(menuItemId);
if (item != null) item.setTitle(title);
}
@Override
public void setMenuItemIntent(int menuItemId, Intent intent) {
+ if (mMenu == null) return;
MenuItem item = mMenu.findItem(menuItemId);
if (item != null) item.setIntent(intent);
}