[PATCH 1/5] tracker: prevent crashes if connection to tracker can't be made



From: Lionel Landwerlin <lionel g landwerlin linux intel com>

Signed-off-by: Lionel Landwerlin <lionel g landwerlin linux intel com>
---
 src/media/tracker/grl-tracker.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/media/tracker/grl-tracker.c b/src/media/tracker/grl-tracker.c
index 11a4e66..d995a90 100644
--- a/src/media/tracker/grl-tracker.c
+++ b/src/media/tracker/grl-tracker.c
@@ -137,11 +137,18 @@ tracker_get_connection_cb (GObject             *object,
                            GAsyncResult        *res,
                            const GrlPluginInfo *plugin)
 {
-  /* GrlTrackerMedia *source; */
+  GError *error = NULL;
 
   GRL_DEBUG ("%s", __FUNCTION__);
 
-  grl_tracker_connection = tracker_sparql_connection_get_finish (res, NULL);
+  grl_tracker_connection = tracker_sparql_connection_get_finish (res, &error);
+
+  if (error) {
+    GRL_WARNING ("\tcannot etablish connection with tracker: %s",
+                 error->message);
+    g_error_free (error);
+    return;
+  }
 
   if (grl_tracker_browse_filesystem)
     tracker_sparql_connection_query_async (grl_tracker_connection,
-- 
1.7.4.1



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