[gnome-photos] tracker-change-monitor: Guard against failure to resolve IDs
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] tracker-change-monitor: Guard against failure to resolve IDs
- Date: Wed, 17 Sep 2014 18:53:45 +0000 (UTC)
commit f5c2f517ad563f411600fa5d59fdbdc527e07049
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Sep 17 18:05:39 2014 +0200
tracker-change-monitor: Guard against failure to resolve IDs
I can't think of a reason why this will happen unless we are hitting
some bug in Tracker, but it is happening in the wild. So let's guard
against such scenarios.
Fixes: https://bugzilla.gnome.org/735746
src/photos-tracker-change-monitor.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-tracker-change-monitor.c b/src/photos-tracker-change-monitor.c
index a7cfe69..cb1b066 100644
--- a/src/photos-tracker-change-monitor.c
+++ b/src/photos-tracker-change-monitor.c
@@ -153,7 +153,12 @@ photos_tracker_change_monitor_send_events (PhotosTrackerChangeMonitor *self, GHa
urn_id = photos_tracker_change_event_get_urn_id (change_event);
predicate = (gchar *) g_hash_table_lookup (id_table, GINT_TO_POINTER (predicate_id));
+ if (G_UNLIKELY (predicate == NULL))
+ continue;
+
urn = (gchar *) g_hash_table_lookup (id_table, GINT_TO_POINTER (urn_id));
+ if (G_UNLIKELY (urn == NULL))
+ continue;
photos_tracker_change_event_set_resolved_values (change_event, urn, predicate);
photos_tracker_change_monitor_add_event (self, change_event);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]