[fenix] For issue https://github.com/mozilla-mobile/fenix/issues/22537 crash: BookmarkFragment is attached to a context

pull/600/head
Arturo Mejia 3 years ago committed by mergify[bot]
parent 1e1de90c7d
commit 1284096722

@ -261,9 +261,12 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
}
private suspend fun loadBookmarkNode(guid: String): BookmarkNode? = withContext(IO) {
requireContext().bookmarkStorage
.getTree(guid, false)
?.let { desktopFolders.withOptionalDesktopFolders(it) }
// Only runs if the fragment is attached same as [runIfFragmentIsAttached]
context?.let {
requireContext().bookmarkStorage
.getTree(guid, false)
?.let { desktopFolders.withOptionalDesktopFolders(it) }
}
}
private suspend fun refreshBookmarks() {

Loading…
Cancel
Save