[vlc-commits] [Git][videolan/vlc][master] qml: fix dropping item in playlist view may not open new playlist dialog

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Apr 28 06:49:29 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
1ff77453 by Fatih Uzunoglu at 2025-04-28T06:31:22+00:00
qml: fix dropping item in playlist view may not open new playlist dialog

This is because `itemContainsDrag` may be undefined or null, which is
observed when the list is empty.

With the chaining operator, the evaluation yields undefined, and then
the function can handle the passed undefined index (which is already
the case here with `acceptDropFunc`, where
`DialogsProvider.playlistsDialog()` is called when the passed index is
undefined).

- - - - -


1 changed file:

- modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml


Changes:

=====================================
modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml
=====================================
@@ -426,7 +426,7 @@ MainViewLoader {
             }
 
             listView.acceptDropFunc: function(index, drop) {
-                return root._dropAction(drop, listView.itemContainsDrag.index)
+                return root._dropAction(drop, listView.itemContainsDrag?.index)
             }
 
             listView.dropIndicator: null



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1ff77453adcd7b36d02133b3f5dd5572966e4337

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1ff77453adcd7b36d02133b3f5dd5572966e4337
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list