[gnome-music/wip/jfelder/player-play-song-index] player: Fix song_index check in play method



commit 85da55d3bfb9597263c404ade06f2c886b5bacf6
Author: Jean Felder <jfelder src gnome org>
Date:   Thu Oct 25 10:20:33 2018 +0200

    player: Fix song_index check in play method
    
    song_index can be equal to zero. So, a good comparison is to check if
    song_index is equal to None.

 gnomemusic/player.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 2688b55e..6e81b8a2 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -600,7 +600,7 @@ class Player(GObject.GObject):
         if not self._playlist:
             return
 
-        if (song_index
+        if (song_index is not None
                 and not self._playlist.set_song(song_index)):
             return False
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]