[Android] Fix NullPointerException in the AccessibilityHelper
Nicolas Pomepuy
git at videolan.org
Tue Jun 28 09:00:44 UTC 2022
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Jun 28 07:11:17 2022 +0200| [0c2cd9a66103cfc8c88be70cf08fdec16ca07b9d] | committer: Nicolas Pomepuy
Fix NullPointerException in the AccessibilityHelper
Fixes #2586
> https://code.videolan.org/videolan/vlc-android/commit/0c2cd9a66103cfc8c88be70cf08fdec16ca07b9d
---
.../vlc-android/src/org/videolan/vlc/util/AccessibilityHelper.kt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/util/AccessibilityHelper.kt b/application/vlc-android/src/org/videolan/vlc/util/AccessibilityHelper.kt
index 6d8e172c2..6302b9742 100644
--- a/application/vlc-android/src/org/videolan/vlc/util/AccessibilityHelper.kt
+++ b/application/vlc-android/src/org/videolan/vlc/util/AccessibilityHelper.kt
@@ -39,7 +39,8 @@ fun Activity.isTalkbackIsEnabled() = (getSystemService(ACCESSIBILITY_SERVICE) as
?: false
@BindingAdapter("mediaContentDescription")
-fun mediaDescription(v: View, media: MediaLibraryItem) {
+fun mediaDescription(v: View, media: MediaLibraryItem?) {
+ if (media == null) return
v.contentDescription = when (media) {
is VideoGroup -> TalkbackUtil.getVideoGroup(v.context, media)
is Album -> TalkbackUtil.getAlbum(v.context, media)
More information about the Android
mailing list