[gnome-music] notifications: don't crash if item is None



commit 38ca49b7af6f2c562ecc61c5467e91b9a3f7474b
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Wed Mar 5 12:43:29 2014 +0100

    notifications: don't crash if item is None

 gnomemusic/notification.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gnomemusic/notification.py b/gnomemusic/notification.py
index 5775db1..2e6c5b6 100644
--- a/gnomemusic/notification.py
+++ b/gnomemusic/notification.py
@@ -72,6 +72,8 @@ class NotificationManager:
             self._notification.show()
         else:
             item = self._player.get_current_media()
+            if not item:
+                return
             artist = item.get_string(Grl.METADATA_KEY_ARTIST)\
                 or item.get_author()\
                 or _("Unknown Artist")


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