2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-09 19:10:42 +00:00

For #8408: fix requireContext crash in HomeFragment#onViewCreated

This commit is contained in:
Severin Rudie 2020-02-13 15:29:00 -08:00 committed by Emily Kager
parent 2264e6e1b1
commit 1be812eba0

View File

@ -282,10 +282,10 @@ class HomeFragment : Fragment() {
// TODO remove when viewLifecycleOwner is fixed // TODO remove when viewLifecycleOwner is fixed
val context = context ?: return@launch val context = context ?: return@launch
val iconSize = resources.getDimensionPixelSize(R.dimen.preference_icon_drawable_size) val iconSize = context.resources.getDimensionPixelSize(R.dimen.preference_icon_drawable_size)
val searchEngine = requireComponents.search.provider.getDefaultEngine(context) val searchEngine = context.components.search.provider.getDefaultEngine(context)
val searchIcon = BitmapDrawable(resources, searchEngine.icon) val searchIcon = BitmapDrawable(context.resources, searchEngine.icon)
searchIcon.setBounds(0, 0, iconSize, iconSize) searchIcon.setBounds(0, 0, iconSize, iconSize)
withContext(Main) { withContext(Main) {