[gnome-music] Avoid to play a song without a selected playlist



commit 67d43804575e68dc19d5cd045dfc10b45c6377c8
Author: Fabiano Fidêncio <fidencio redhat com>
Date:   Sun Jun 23 02:05:24 2013 +0200

    Avoid to play a song without a selected playlist
    
    https://bugzilla.gnome.org/show_bug.cgi?id=702879

 src/player.js |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/player.js b/src/player.js
index a2d90bb..96e06c8 100644
--- a/src/player.js
+++ b/src/player.js
@@ -299,6 +299,9 @@ const Player = new Lang.Class({
     },
 
     play: function() {
+        if (this.playlist == null)
+            return;
+
         if (this.player.get_state(1)[1] != Gst.State.PAUSED)
             this.stop();
 
@@ -330,6 +333,9 @@ const Player = new Lang.Class({
     },
 
     playNext: function() {
+        if (this.playlist == null)
+            return;
+
         this.currentTrack = this._getNextTrack();
 
         if (this.currentTrack)
@@ -339,6 +345,9 @@ const Player = new Lang.Class({
     },
 
     playPrevious: function() {
+        if (this.playlist == null)
+            return;
+
         this.currentTrack = this._getPreviousTrack();
 
         if (this.currentTrack)


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