Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dcc55855 authored by Adam Powell's avatar Adam Powell
Browse files

Fix a NPE in MenuItemImpl when setting null ActionProvider

Change-Id: I00be010b2197d0f41d0e45b3814474d3ad0c3295
parent 48f2b548
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -598,11 +598,13 @@ public final class MenuItemImpl implements MenuItem {
        mActionView = null;
        mActionProvider = actionProvider;
        mMenu.onItemsChanged(true); // Measurement can be changed
        if (mActionProvider != null) {
            mActionProvider.setVisibilityListener(new ActionProvider.VisibilityListener() {
                @Override public void onActionProviderVisibilityChanged(boolean isVisible) {
                    mMenu.onItemVisibleChanged(MenuItemImpl.this);
                }
            });
        }
        return this;
    }