[Android] Fix NullPointerException on trackInfoView

Nicolas Pomepuy git at videolan.org
Tue Feb 8 14:39:35 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri Feb  4 08:37:46 2022 +0100| [e2c0232443da35247648f9b326e98324eeba192b] | committer: Nicolas Pomepuy

Fix NullPointerException on trackInfoView

> https://code.videolan.org/videolan/vlc-android/commit/e2c0232443da35247648f9b326e98324eeba192b
---

 .../vlc-android/src/org/videolan/vlc/gui/view/CoverMediaSwitcher.kt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/view/CoverMediaSwitcher.kt b/application/vlc-android/src/org/videolan/vlc/gui/view/CoverMediaSwitcher.kt
index 0a90a8d96..9463b624c 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/view/CoverMediaSwitcher.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/view/CoverMediaSwitcher.kt
@@ -66,8 +66,10 @@ class CoverMediaSwitcher(context: Context, attrs: AttributeSet) : AudioMediaSwit
         if (Settings.listTitleEllipsize == 4) titleView.isSelected = true
         setEllipsizeModeByPref(artistView, true)
         if (Settings.listTitleEllipsize == 4) artistView.isSelected = true
-        setEllipsizeModeByPref(trackInfoView, true)
-        if (Settings.listTitleEllipsize == 4) trackInfoView.isSelected = true
+        trackInfoView?.let {
+            setEllipsizeModeByPref(it, true)
+            if (Settings.listTitleEllipsize == 4) it.isSelected = true
+        }
 
         addView(v)
 



More information about the Android mailing list