For #18439 - Open link from QR code only if activity is not null

upstream-sync
Mugurell 3 years ago
parent 0d37471b0a
commit abe3036065

@ -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