prevent traceback when player is no more on dbus. fixes #4131

This commit is contained in:
Yann Leboulanger 2008-07-29 07:52:51 +00:00
parent 64b73530c4
commit 69b088b4b9
1 changed files with 4 additions and 1 deletions

View File

@ -217,7 +217,10 @@ class MusicTrackListener(gobject.GObject):
bus.get_object('org.gnome.Rhythmbox', bus.get_object('org.gnome.Rhythmbox',
'/org/gnome/Rhythmbox/Player'), 'org.gnome.Rhythmbox.Player') '/org/gnome/Rhythmbox/Player'), 'org.gnome.Rhythmbox.Player')
rbshell = dbus.Interface(rbshellobj, 'org.gnome.Rhythmbox.Shell') rbshell = dbus.Interface(rbshellobj, 'org.gnome.Rhythmbox.Shell')
uri = player.getPlayingUri() try:
uri = player.getPlayingUri()
except dbus.DBusException:
uri = None
if not uri: if not uri:
return None return None
props = rbshell.getSongProperties(uri) props = rbshell.getSongProperties(uri)