[Android] Fix JobCancellationException

Nicolas Pomepuy git at videolan.org
Fri Oct 2 07:52:25 CEST 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri Oct  2 07:10:57 2020 +0200| [99b4651f01dd08a6660e873016a6e9898603ff49] | committer: Nicolas Pomepuy

Fix JobCancellationException

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

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

diff --git a/application/vlc-android/src/org/videolan/vlc/viewmodels/PlaylistModel.kt b/application/vlc-android/src/org/videolan/vlc/viewmodels/PlaylistModel.kt
index 14523f0b6..c4f696a6f 100644
--- a/application/vlc-android/src/org/videolan/vlc/viewmodels/PlaylistModel.kt
+++ b/application/vlc-android/src/org/videolan/vlc/viewmodels/PlaylistModel.kt
@@ -32,6 +32,7 @@ import kotlinx.coroutines.flow.onEach
 import org.videolan.medialibrary.Tools
 import org.videolan.medialibrary.interfaces.media.MediaWrapper
 import org.videolan.tools.livedata.LiveDataset
+import org.videolan.tools.safeOffer
 import org.videolan.vlc.PlaybackService
 import org.videolan.vlc.media.PlaylistManager
 import org.videolan.vlc.util.EmptyPBSCallback
@@ -96,7 +97,7 @@ class PlaylistModel : ViewModel(), PlaybackService.Callback by EmptyPBSCallback
             this.filtering = filtering
             originalDataset = if (filtering) dataset.value.toMutableList() else null
         }
-        filterActor.offer(query)
+        filterActor.safeOffer(query)
     }
 
     val title



More information about the Android mailing list