[gnome-music] Avoid crash using Previous/Next (multimedia keys)



commit 48c580f02fda113a5d91e7310a5d3ef7d2787ed1
Author: Fabiano Fidêncio <fidencio redhat com>
Date:   Sun Jun 23 04:18:41 2013 +0200

    Avoid crash using Previous/Next (multimedia keys)
    
    Only call _get{Previous,Next}Track if there is a previous/next track.
    We didn't need to check it before because the Previous/Next buttons are
    disabled in the first/last playlist's track. Now, with the Multimedia
    keys we need to force the same behavior.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=702879

 src/player.js |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/player.js b/src/player.js
index 732b4e8..494b4db 100644
--- a/src/player.js
+++ b/src/player.js
@@ -336,6 +336,9 @@ const Player = new Lang.Class({
         if (this.playlist == null)
             return;
 
+        if (!this.nextBtn.sensitive)
+            return;
+
         this.stop();
         this.currentTrack = this._getNextTrack();
 
@@ -347,6 +350,9 @@ const Player = new Lang.Class({
         if (this.playlist == null)
             return;
 
+        if (!this.prevBtn.sensitive)
+            return;
+
         this.stop();
         this.currentTrack = this._getPreviousTrack();
 


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