Bug 2059390: fix crash in SitePermissionsFragment.onDismiss #321 (firefox-autoland@autoland)

Warnings
  • Checking...
Blockers
  • Checking...
Branches fix-crash-site-permissions -> autoland
Repo firefox-autoland@autoland (git) (git://github.com/pollym/firefox.git)
Author pollym
State closed
Commit Title

Bug 2059390: fix crash in SitePermissionsFragment.onDismiss

Commit Body

If a fragment is detached, it is no longer safe to call `requireComponents`, because this method throws if the `context` is null. In this case, `BaseBrowserFragment` is not attached and returning true from `shouldHide` will stop us from showing the permission prompt, rather than crashing. Also checked `hidePermissionsPrompt` which will be called if `shouldHide` is true. This allows for the case of the fragment not being attached by using an optional and a let, so should be safe to call in this detached fragment case. [try is running here](https://treeherder.mozilla.org/jobs?repo=try&revision=8dbfc878c87991d2da9167e8ad5daed2bb54579a)

Landings

Successfully landed

Landing requested on , by pmceldowney@mozilla.com.

Landing Job: 73806

Last update:

Result: 4dbfb9dc06e14786c57feca0ef20f95a5ed75f3c on firefox-autoland@autoland (git)

Links: Treeherder