Skip to content
Snippets Groups Projects
Commit da04035b authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Geoffrey Métais
Browse files

Fix TypeCastException

(cherry picked from commit 78efb6e1)
parent d1db7442
No related branches found
No related tags found
No related merge requests found
......@@ -182,7 +182,7 @@ class FileBrowserTvFragment : BaseBrowserTvFragment(), PathAdapterListener {
animationDelegate.setVisibility(binding.favoriteButton, View.VISIBLE)
animationDelegate.setVisibility(binding.imageButtonFavorite, View.VISIBLE)
animationDelegate.setVisibility(binding.favoriteDescription, View.VISIBLE)
favExists = withContext(Dispatchers.IO) { browserFavRepository.browserFavExists((item as MediaWrapper).uri) }
favExists = withContext(Dispatchers.IO) { if (item == null) false else if (item is MediaWrapper) browserFavRepository.browserFavExists((item as MediaWrapper).uri) else false }
binding.favoriteButton.setImageResource(if (favExists) R.drawable.ic_menu_fav_tv else R.drawable.ic_menu_not_fav_tv)
binding.imageButtonFavorite.setImageResource(if (favExists) R.drawable.ic_menu_fav_tv_normal else R.drawable.ic_menu_not_fav_tv_normal)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment