[grilo-plugins/tracker-notification] tracker: fix null pointer usage



commit 4e693ba5ec9b06d757ecb21d86926ba0b2a75571
Author: Lionel Landwerlin <lionel g landwerlin linux intel com>
Date:   Mon Feb 21 15:11:03 2011 +0000

    tracker: fix null pointer usage
    
    Only spotted in case of tracker-control -k -r && tracker-control -s
    
    Signed-off-by: Lionel Landwerlin <lionel g landwerlin linux intel com>

 src/tracker/grl-tracker-notif.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker/grl-tracker-notif.c b/src/tracker/grl-tracker-notif.c
index f14d0bc..df70d10 100644
--- a/src/tracker/grl-tracker-notif.c
+++ b/src/tracker/grl-tracker-notif.c
@@ -180,7 +180,7 @@ tracker_evt_update_orphan_item_cb (GObject              *object,
 {
   guint id;
   const gchar *type, *datasource;
-  GrlTrackerSource *source;
+  GrlTrackerSource *source = NULL;
   GError *error = NULL;
 
   GRL_DEBUG ("%s: evt=%p", __FUNCTION__, evt);
@@ -208,7 +208,8 @@ tracker_evt_update_orphan_item_cb (GObject              *object,
 
   GRL_DEBUG ("\tOrphan item: id=%u datasource=%s", id, datasource);
 
-  source = grl_tracker_source_find (datasource);
+  if (datasource)
+    source = grl_tracker_source_find (datasource);
 
   if (source && GRL_IS_TRACKER_SOURCE (source)) {
     GrlMedia *media;



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