[gnome-music] Don't crash in about-to-finish on last song



commit 23e4cce8ea52145de7ac3b49960750bf4987b02f
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Tue Apr 30 18:17:53 2013 +0200

    Don't crash in about-to-finish on last song

 src/player.js |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/player.js b/src/player.js
index d2a3fa9..58be97d 100644
--- a/src/player.js
+++ b/src/player.js
@@ -109,10 +109,13 @@ const Player = new Lang.Class({
             return true;
         }));
 
+
         // Set URI earlier - this will enable gapless playback
         this.player.connect("about-to-finish", Lang.bind(this, function(player) {
-            player.set_property('uri', player.next_url);
-            GLib.idle_add(GLib.PRIORITY_HIGH, Lang.bind(this, this.load_next_track));
+            if(player.next_url != null) {
+                player.set_property('uri', player.next_url);
+                GLib.idle_add(GLib.PRIORITY_HIGH, Lang.bind(this, this.load_next_track));
+            }
             return true;
         }));
         this._setup_view();


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