summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-04-16 16:25:54 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-04-16 16:53:55 +0200
commita02a0deb23cd62d472114ab71d4b0b6aee8b736c (patch)
tree47964927d40f3ad80382324bbdd82e7ea06cbc4b
parent197eea35e538c60b691241c10bcdcefd9b14b9b2 (diff)
location: return an empty hash to GetContactAttributes if there is no location
Fix fdo #27694
-rw-r--r--src/conn-location.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/conn-location.c b/src/conn-location.c
index d69ae3b31..569da9bc3 100644
--- a/src/conn-location.c
+++ b/src/conn-location.c
@@ -536,19 +536,21 @@ conn_location_fill_contact_attributes (GObject *obj,
{
TpHandle handle = g_array_index (contacts, TpHandle, i);
GHashTable *location;
+ GValue *val;
location = get_cached_location_or_query (self, handle, NULL);
if (location != NULL)
- {
- GValue *val = tp_g_value_slice_new_boxed (
- TP_HASH_TYPE_STRING_VARIANT_MAP, location);
+ g_hash_table_ref (location);
+ else
+ location = g_hash_table_new (NULL, NULL);
- tp_contacts_mixin_set_contact_attribute (attributes_hash,
- handle, TP_IFACE_CONNECTION_INTERFACE_LOCATION"/location",
- val);
+ val = tp_g_value_slice_new_boxed (TP_HASH_TYPE_STRING_VARIANT_MAP,
+ location);
- g_hash_table_unref (location);
- }
+ tp_contacts_mixin_set_contact_attribute (attributes_hash,
+ handle, TP_IFACE_CONNECTION_INTERFACE_LOCATION"/location", val);
+
+ g_hash_table_unref (location);
}
}