[gnome-music/gnome-3-14] Handle tracker query crash correctly



commit c0c1ab827964e0649bf43156a420f7e3d6ea0770
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Fri Oct 3 14:00:47 2014 +0200

    Handle tracker query crash correctly
    
    User will be redirected to No Music page in this case
    
    https://bugzilla.gnome.org/show_bug.cgi?id=733686

 gnomemusic/window.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 9fda927..5a9a995 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -196,7 +196,13 @@ class Window(Gtk.ApplicationWindow):
         self._box.pack_start(self.selection_toolbar.actionbar, False, False, 0)
         self.add(self._box)
         count = 1
-        cursor = tracker.query(Query.all_songs_count(), None)
+        cursor = None
+        try:
+            cursor = tracker.query(Query.all_songs_count(), None)
+        except Exception as e:
+            logger.error("Tracker query crashed: %s" % e)
+            count = 0
+
         if cursor is not None and cursor.next(None):
             count = cursor.get_integer(0)
         if count > 0:


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