[Android] Fix TypeCastException
Nicolas Pomepuy
git at videolan.org
Mon Sep 23 18:10:25 CEST 2019
vlc-android | branch: 3.2.x | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Wed Sep 11 09:29:37 2019 +0200| [da04035b510d604125e9fd8816ad28a8cb87e1b0] | committer: Geoffrey Métais
Fix TypeCastException
(cherry picked from commit 78efb6e13a10399d0739eaafa5d6d40c3e287102)
> https://code.videolan.org/videolan/vlc-android/commit/da04035b510d604125e9fd8816ad28a8cb87e1b0
---
.../src/org/videolan/vlc/gui/tv/browser/FileBrowserTvFragment.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/FileBrowserTvFragment.kt b/vlc-android/src/org/videolan/vlc/gui/tv/browser/FileBrowserTvFragment.kt
index 055208a74..77a71deb9 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/FileBrowserTvFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/FileBrowserTvFragment.kt
@@ -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)
}
More information about the Android
mailing list