[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 4 years ago
parent 7abe6bc827
commit c2a4f16fe8

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

Loading…
Cancel
Save