[gnome-music/wip/merge: 85/343] Fix AttributeError by checking if self.playlist is None



commit f0d34b31d470ada4430d9b071ca76aead775ffb4
Author: Shivani Poddar <shivani poddar92 gmail com>
Date:   Mon Jul 15 13:14:22 2013 +0530

    Fix AttributeError by checking if self.playlist is None

 gnomemusic/player.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 3fcf691..6b27523 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -137,8 +137,9 @@ class Player(GObject.GObject):
             self.playBtn.set_image(self._playImage)
             self.progressScale.set_value(0)
             self.progressScale.sensitive = False
-            self.currentTrack = self.playlist.get_iter_first()[1]
-            self.load(self.playlist.get_value(self.currentTrack, self.playlistField))
+            if self.playlist is not None:
+                self.currentTrack = self.playlist.get_iter_first()[1]
+                self.load(self.playlist.get_value(self.currentTrack, self.playlistField))
         else:
             #Stop playback
             self.stop()


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