[Android] AudioBrowserFragment: fix possible crashes

Jean-Baptiste Kempf git at videolan.org
Fri Dec 14 19:29:49 CET 2012


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Dec 14 19:29:20 2012 +0100| [d29325cca97d7d35d0ea22f15df202869ec54ea7] | committer: Jean-Baptiste Kempf

AudioBrowserFragment: fix possible crashes

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=d29325cca97d7d35d0ea22f15df202869ec54ea7
---

 .../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java     |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index ca246b6..2c97359 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -359,9 +359,11 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
             if (hl == null)
                 return;
             TextView oldView = (TextView) hl.getChildAt(mCurrentPosition);
-            oldView.setTextColor(Color.GRAY);
+            if (oldView != null)
+                oldView.setTextColor(Color.GRAY);
             TextView newView = (TextView) hl.getChildAt(position);
-            newView.setTextColor(Color.WHITE);
+            if (newView != null)
+                newView.setTextColor(Color.WHITE);
             mCurrentPosition = position;
         }
 



More information about the Android mailing list