[gnome-music/freeze-break: 28/107] player: Ignore Play button if no track is available



commit b35cf32684e11e6fe4e5e49cfa15bef8e72a353c
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Wed Sep 4 19:35:04 2013 +0800

    player: Ignore Play button if no track is available
    
    This fixes a crash if there is no track to play.

 gnomemusic/player.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 23cdcc6..18a8e1b 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -364,7 +364,11 @@ class Player(GObject.GObject):
         if self.player.get_state(1)[1] != Gst.State.PAUSED:
             self.stop()
 
-        self.load(self.get_current_media())
+        media = self.get_current_media()
+        if not media:
+            return
+
+        self.load(media)
 
         self.player.set_state(Gst.State.PLAYING)
         self._update_position_callback()


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