diff options
| author | Adam Powell <adamp@google.com> | 2013-05-06 12:20:14 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2013-05-06 12:20:14 -0700 |
| commit | ef5352c3a18c41e74afcb3609ef99942634d15d6 (patch) | |
| tree | 9c2347e4747b88f54f30047445f8b8d7efdd0aac | |
| parent | 82700920d74b519de65edf5dfe2ae8a3ed6e2e03 (diff) | |
| parent | f581b533cf0ff774405bae057f5883fe9768c6a8 (diff) | |
| download | frameworks_base-ef5352c3a18c41e74afcb3609ef99942634d15d6.zip frameworks_base-ef5352c3a18c41e74afcb3609ef99942634d15d6.tar.gz frameworks_base-ef5352c3a18c41e74afcb3609ef99942634d15d6.tar.bz2 | |
am f581b533: am 2b662e8e: Merge "Fix a NPE in MenuItemImpl when setting null ActionProvider" into jb-mr2-dev
* commit 'f581b533cf0ff774405bae057f5883fe9768c6a8':
Fix a NPE in MenuItemImpl when setting null ActionProvider
| -rw-r--r-- | core/java/com/android/internal/view/menu/MenuItemImpl.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/core/java/com/android/internal/view/menu/MenuItemImpl.java b/core/java/com/android/internal/view/menu/MenuItemImpl.java index 7189610..39078ca 100644 --- a/core/java/com/android/internal/view/menu/MenuItemImpl.java +++ b/core/java/com/android/internal/view/menu/MenuItemImpl.java @@ -598,11 +598,13 @@ public final class MenuItemImpl implements MenuItem { mActionView = null; mActionProvider = actionProvider; mMenu.onItemsChanged(true); // Measurement can be changed - mActionProvider.setVisibilityListener(new ActionProvider.VisibilityListener() { - @Override public void onActionProviderVisibilityChanged(boolean isVisible) { - mMenu.onItemVisibleChanged(MenuItemImpl.this); - } - }); + if (mActionProvider != null) { + mActionProvider.setVisibilityListener(new ActionProvider.VisibilityListener() { + @Override public void onActionProviderVisibilityChanged(boolean isVisible) { + mMenu.onItemVisibleChanged(MenuItemImpl.this); + } + }); + } return this; } |
