mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-03 23:15:31 +00:00
Closes #15812: Check for a null context during onScanResult
This commit is contained in:
parent
d5bef99834
commit
2030580fc8
@ -37,6 +37,15 @@ class PairFragment : Fragment(R.layout.fragment_pair), UserInteractionHandler {
|
||||
requestPermissions(permissions, REQUEST_CODE_CAMERA_PERMISSIONS)
|
||||
},
|
||||
onScanResult = { pairingUrl ->
|
||||
// By the time we get a scan result, we may not be attached to the context anymore.
|
||||
// See https://github.com/mozilla-mobile/fenix/issues/15812
|
||||
if (context == null) {
|
||||
findNavController().popBackStack(
|
||||
R.id.turnOnSyncFragment,
|
||||
false
|
||||
)
|
||||
return@QrFeature
|
||||
}
|
||||
requireComponents.services.accountsAuthFeature.beginPairingAuthentication(
|
||||
requireContext(),
|
||||
pairingUrl
|
||||
@ -53,7 +62,7 @@ class PairFragment : Fragment(R.layout.fragment_pair), UserInteractionHandler {
|
||||
@Suppress("Deprecation")
|
||||
vibrator.vibrate(VIBRATE_LENGTH)
|
||||
}
|
||||
findNavController(this@PairFragment).popBackStack(
|
||||
findNavController().popBackStack(
|
||||
R.id.turnOnSyncFragment,
|
||||
false
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user