[Android] Prevent NPE

Geoffrey Métais git at videolan.org
Thu Jan 12 17:15:41 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jan 12 16:58:30 2017 +0100| [91eac5005d8810e48773a4ef818afc516d1b5096] | committer: Geoffrey Métais

Prevent NPE

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

 vlc-android/src/org/videolan/vlc/util/MediaItemDiffCallback.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/util/MediaItemDiffCallback.java b/vlc-android/src/org/videolan/vlc/util/MediaItemDiffCallback.java
index 81b83c7..d77c693 100644
--- a/vlc-android/src/org/videolan/vlc/util/MediaItemDiffCallback.java
+++ b/vlc-android/src/org/videolan/vlc/util/MediaItemDiffCallback.java
@@ -33,7 +33,7 @@ public class MediaItemDiffCallback extends DiffUtil.Callback {
 
     @Override
     public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
-        return oldList[oldItemPosition].equals(newList[newItemPosition]);
+        return !(oldList[oldItemPosition] != null ^ newList[newItemPosition] !=null) && oldList[oldItemPosition].equals(newList[newItemPosition]);
     }
 
     @Override



More information about the Android mailing list