From 3b75fb1370a5aac7cd239a5b2e053ff0b3da8ffa Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Sat, 6 Jul 2019 02:43:39 -0600 Subject: [PATCH] Fixed bug with right click on no song in playlist list --- libremsonic/ui/playlists.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libremsonic/ui/playlists.py b/libremsonic/ui/playlists.py index d0f1eaf..864720a 100644 --- a/libremsonic/ui/playlists.py +++ b/libremsonic/ui/playlists.py @@ -369,7 +369,10 @@ class PlaylistsPanel(Gtk.Paned): def on_song_button_press(self, tree, event): if event.button == 3: # Right click - clicked_path = tree.get_path_at_pos(event.x, event.y)[0] + clicked_path = tree.get_path_at_pos(event.x, event.y) + if not clicked_path: + return False + store, paths = tree.get_selection().get_selected_rows() allow_deselect = False @@ -381,8 +384,8 @@ class PlaylistsPanel(Gtk.Paned): # Use the new selection instead of the old one for calculating what # to do the right click on. - if clicked_path not in paths: - paths = [clicked_path] + if clicked_path[0] not in paths: + paths = [clicked_path[0]] allow_deselect = True song_ids = [self.playlist_song_model[p][-1] for p in paths]