From 14819097275f60f97d9960dee3f031a11223ca47 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 26 Mar 2010 15:55:57 +0100 Subject: map_view_update_contact_position: create marker if needed --- src/empathy-map-view.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c index cf89e2a29..2481accd6 100644 --- a/src/empathy-map-view.c +++ b/src/empathy-map-view.c @@ -87,6 +87,9 @@ contact_has_location (EmpathyContact *contact) return TRUE; } +static ChamplainMarker * create_marker (EmpathyMapView *window, + EmpathyContact *contact); + static void map_view_update_contact_position (EmpathyMapView *self, EmpathyContact *contact) @@ -97,7 +100,13 @@ map_view_update_contact_position (EmpathyMapView *self, ChamplainMarker *marker; marker = g_hash_table_lookup (self->markers, contact); - g_assert (marker != NULL); + if (marker == NULL) + { + if (!contact_has_location (contact)) + return; + + marker = create_marker (self, contact); + } location = empathy_contact_get_location (contact); -- cgit v1.2.3