[tracker] tracker: Check error on tracker_sparql_cursor_next() call
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tracker: Check error on tracker_sparql_cursor_next() call
- Date: Wed, 14 Dec 2016 19:44:43 +0000 (UTC)
commit cd132a10a07c1549e1c837fb50c2d9b8d385dfd7
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Dec 14 20:04:44 2016 +0100
tracker: Check error on tracker_sparql_cursor_next() call
And make it clear we poke the GError contents if there is one,
although next() isn't really expected to fail on a "SELECT
COUNT..." query.
src/tracker/tracker-status.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker/tracker-status.c b/src/tracker/tracker-status.c
index 8364dd2..b963eb4 100644
--- a/src/tracker/tracker-status.c
+++ b/src/tracker/tracker-status.c
@@ -519,7 +519,10 @@ get_file_and_folder_count (int *files,
cursor = tracker_sparql_connection_query (connection, query, NULL, &error);
- if (error || !tracker_sparql_cursor_next (cursor, NULL, NULL)) {
+ if (cursor)
+ tracker_sparql_cursor_next (cursor, NULL, &error);
+
+ if (error) {
g_printerr ("%s, %s\n",
_("Could not get basic status for Tracker"),
error->message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]