[grilo-plugins] tracker: fix null pointer usage



commit 17c94e0d9b3cf93957e91394fde1c8d41f7e8f2c
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/media/tracker/grl-tracker-notif.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/media/tracker/grl-tracker-notif.c b/src/media/tracker/grl-tracker-notif.c
index f14d0bc..df70d10 100644
--- a/src/media/tracker/grl-tracker-notif.c
+++ b/src/media/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]