[Android] ViewModels: Fix medialist update

Geoffrey Métais git at videolan.org
Thu Apr 26 13:59:15 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Apr 25 18:46:56 2018 +0200| [d11237e855784d5e31e2d976ed0502ac2f307a24] | committer: Geoffrey Métais

ViewModels: Fix medialist update

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

 vlc-android/src/org/videolan/vlc/viewmodels/BaseModel.kt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/viewmodels/BaseModel.kt b/vlc-android/src/org/videolan/vlc/viewmodels/BaseModel.kt
index 063f4963a..8b6525d1b 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/BaseModel.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/BaseModel.kt
@@ -125,7 +125,8 @@ abstract class BaseModel<T : MediaLibraryItem> : ViewModel(), RefreshModel {
         dataset.value = withContext(CommonPool) {
             val list = dataset.value
             val iterator = list.listIterator()
-            for (media in iterator) {
+            while (iterator.hasNext()) {
+                val media = iterator.next()
                 for (newItem in mediaList) if (media.equals(newItem)) {
                     iterator.set(newItem)
                     break



More information about the Android mailing list