[fenix] For https://github.com/mozilla-mobile/fenix/issues/18439 - Open link from QR code only if activity is not null

pull/600/head
Mugurell 3 years ago
parent 7abe6bc827
commit c2a4f16fe8

@ -434,12 +434,11 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
dialog.cancel()
}
setPositiveButton(R.string.qr_scanner_dialog_positive) { dialog: DialogInterface, _ ->
(activity as HomeActivity)
.openToBrowserAndLoad(
searchTermOrURL = result,
newTab = store.state.tabId == null,
from = BrowserDirection.FromSearchDialog
)
(activity as? HomeActivity)?.openToBrowserAndLoad(
searchTermOrURL = result,
newTab = store.state.tabId == null,
from = BrowserDirection.FromSearchDialog
)
dialog.dismiss()
}
create()

Loading…
Cancel
Save