[tracker] tracker-store: Print warning if unable to initialize statistics



commit 8e96a61a31da2682b3808ec8d5a01af72d6f3cab
Author: JÃrg Billeter <j bitron ch>
Date:   Thu Jan 26 16:33:44 2012 +0100

    tracker-store: Print warning if unable to initialize statistics

 src/tracker-store/tracker-statistics.vala |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-store/tracker-statistics.vala b/src/tracker-store/tracker-statistics.vala
index d1a92f1..0e2b45f 100644
--- a/src/tracker-store/tracker-statistics.vala
+++ b/src/tracker-store/tracker-statistics.vala
@@ -39,8 +39,11 @@ public class Tracker.Statistics : Object {
 						                            cl.name);
 
 					var stat_cursor = stmt.start_cursor ();
-					stat_cursor.next ();
-					cl.count = (int) stat_cursor.get_integer (0);
+					if (stat_cursor.next ()) {
+						cl.count = (int) stat_cursor.get_integer (0);
+					} else {
+						warning ("Unable to query instance count for class %s", cl.name);
+					}
 				}
 			}
 



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