[Android] Fix playlist creation regression

Nicolas Pomepuy git at videolan.org
Fri Mar 13 14:04:45 CET 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Mar 12 09:21:14 2020 +0100| [e60c06c12a2b4ab9cd267e7a63a8dfb3df4d5c8a] | committer: Geoffrey Métais

Fix playlist creation regression

Fixes #1224

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

 .../vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.kt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.kt
index 7daa89c59..17bcab1c2 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.kt
@@ -155,10 +155,9 @@ class SavePlaylistDialog : VLCBottomSheetDialogFragment(), View.OnClickListener,
     private fun savePlaylist() {
         val name = binding.dialogPlaylistName.editText?.text?.toString()?.trim { it <= ' ' }
                 ?: return
-        val playlistId = currentPLaylist?.id ?: return
         AppScope.launch(coroutineContextProvider.IO) {
             var playlist = if (currentPLaylist?.title == name) {
-                medialibrary.getPlaylist(playlistId)
+                medialibrary.getPlaylist(currentPLaylist?.id ?: return at launch)
             } else {
                 medialibrary.getPlaylistByName(name) ?: medialibrary.createPlaylist(name)
                 ?: return at launch



More information about the Android mailing list