[Android] Prevent NPE for async updates

Geoffrey Métais git at videolan.org
Tue Dec 9 17:21:45 CET 2014


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Dec  9 17:20:33 2014 +0100| [16b2559cc69bfc76290c904faec8fde92600fe86] | committer: Geoffrey Métais

Prevent NPE for async updates

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

 vlc-android/tv/src/org/videolan/vlc/gui/tv/GridFragment.java |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vlc-android/tv/src/org/videolan/vlc/gui/tv/GridFragment.java b/vlc-android/tv/src/org/videolan/vlc/gui/tv/GridFragment.java
index 08db358..c67adcc 100644
--- a/vlc-android/tv/src/org/videolan/vlc/gui/tv/GridFragment.java
+++ b/vlc-android/tv/src/org/videolan/vlc/gui/tv/GridFragment.java
@@ -146,7 +146,8 @@ public class GridFragment extends VerticalGridFragment implements VideoBrowserIn
     }
 
     public void updateItem() {
-        if (mAdapter != null && mMediaIndex.containsKey(mItemToUpdate.getLocation()))
+        if (mAdapter != null && mMediaIndex != null && mItemToUpdate != null
+                && mMediaIndex.containsKey(mItemToUpdate.getLocation()))
             mAdapter.notifyArrayItemRangeChanged(mMediaIndex.get(mItemToUpdate.getLocation()), 1);
         try {
             mBarrier.await();



More information about the Android mailing list