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

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

Fix bug 3198503 - NPE at MenuPopupHelper.dismiss

Make sure dismiss() can be called even when the popup is not currently
showing.

Change-Id: I48077d8b3bfe0df04bceeb056ed54cbd79a6e660
parent debf3bed
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -110,9 +110,11 @@ public class MenuPopupHelper implements AdapterView.OnItemClickListener, View.On
        if (isShowing()) {
        if (isShowing()) {
            mPopup.dismiss();
            mPopup.dismiss();
        }
        }
        if (mTreeObserver != null) {
            mTreeObserver.removeGlobalOnLayoutListener(this);
            mTreeObserver.removeGlobalOnLayoutListener(this);
            mTreeObserver = null;
            mTreeObserver = null;
        }
        }
    }


    public boolean isShowing() {
    public boolean isShowing() {
        return mPopup != null && mPopup.isShowing();
        return mPopup != null && mPopup.isShowing();