зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1366352 - Post: check anchor is set before trying to show GeckoPopupMenu r=nechen
This means we'll at least see a sensible exception, instead of an NPE when no anchor is set. That makes it easier to debug cases where no anchor was set (see e.g. the main commit from this bug). MozReview-Commit-ID: CzsZaHvnZ6y --HG-- extra : rebase_source : 2aaf737b49367d9e70fc62a1226e038c79f573e3
This commit is contained in:
Родитель
f9367a3210
Коммит
657c2807d0
|
@ -137,6 +137,10 @@ public class GeckoPopupMenu implements GeckoMenu.Callback,
|
|||
* Show the inflated menu.
|
||||
*/
|
||||
public void show() {
|
||||
if (mAnchor == null) {
|
||||
throw new IllegalStateException("GeckoPopupMenu.show() called without preceeding call to setAnchor()");
|
||||
}
|
||||
|
||||
if (!mMenuPopup.isShowing())
|
||||
mMenuPopup.showAsDropDown(mAnchor);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче