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

Commit 99d72497 authored by Alan Viverette's avatar Alan Viverette
Browse files

Fix NPE in PopupMenu.getDragToOpenListener()

BUG: 10912382
Change-Id: I206e697b4781c4d03ebc01aa675511d89c1656af
parent 840b3bd6
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -92,8 +92,21 @@ public class PopupMenu implements MenuBuilder.Callback, MenuPresenter.Callback {
    public OnTouchListener getDragToOpenListener() {
        if (mDragListener == null) {
            mDragListener = new ForwardingListener(mAnchor) {
                @Override
                protected boolean onForwardingStarted() {
                    show();
                    return true;
                }

                @Override
                protected boolean onForwardingStopped() {
                    dismiss();
                    return true;
                }

                @Override
                public ListPopupWindow getPopup() {
                    // This will be null until show() is called.
                    return mPopup.getPopup();
                }
            };