Check for null MenuHelper before setting presenter callback

Bug: 26219569
Change-Id: Ia19a1304aa10dac52b89d0ee85acdb5671a15777
This commit is contained in:
Alan Viverette
2015-12-16 09:56:37 -05:00
parent db08925a8f
commit 9084d22cb9

View File

@@ -702,11 +702,13 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
helper = mWindow.mContextMenu.showDialog(originalView, originalView.getWindowToken());
}
// If it's a dialog, the callback needs to handle showing sub-menus.
// Either way, the callback is required for propagating selection to
// Context.onContextMenuItemSelected().
callback.setShowDialogForSubmenu(!isPopup);
helper.setPresenterCallback(callback);
if (helper != null) {
// If it's a dialog, the callback needs to handle showing
// sub-menus. Either way, the callback is required for propagating
// selection to Context.onContextMenuItemSelected().
callback.setShowDialogForSubmenu(!isPopup);
helper.setPresenterCallback(callback);
}
mWindow.mContextMenuHelper = helper;
return helper != null;