android: Prevent situation where binding is called on a null view

master
Charles Lombardo 2023-04-23 18:46:42 +07:00 committed by bunnei
parent d7178ed16e
commit 62c47011a0
1 changed files with 3 additions and 0 deletions

@ -140,6 +140,9 @@ class GamesFragment : Fragment() {
// Make sure the loading indicator appears even if the layout is told to refresh before being fully drawn
binding.swipeRefresh.post {
if (_binding == null) {
return@post
}
binding.swipeRefresh.isRefreshing = gamesViewModel.isReloading.value!!
}
}