summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2011-04-26 17:52:48 +0100
committerJonny Lamb <jonny.lamb@collabora.co.uk>2011-04-26 17:52:48 +0100
commit0a212aa1bf6c3120c036e11d5f32c300d0aad78e (patch)
treefa11cbc451ad0870b8f17910e3e5b4dd5bfe7d57
parentdcb9f16c35c28ddd426f5d4db3455ca312705271 (diff)
status: don't bail on reading capabilities if there is no name/caps
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--salut/status.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/salut/status.c b/salut/status.c
index 9059688..f38c36a 100644
--- a/salut/status.c
+++ b/salut/status.c
@@ -372,25 +372,27 @@ contact_capabilities_changed (YtstStatus *self,
/* name map */
tmp = g_hash_table_lookup (form->fields, "name");
- if (tmp == NULL)
+ if (tmp != NULL && tmp->default_value != NULL)
{
- g_free (yts_service_name);
- continue;
+ yts_name_map = get_name_map_from_strv (
+ g_value_get_boxed (tmp->default_value));
+ }
+ else
+ {
+ yts_name_map = g_hash_table_new (g_str_hash, g_str_equal);
}
-
- yts_name_map = get_name_map_from_strv (
- g_value_get_boxed (tmp->default_value));
/* caps */
tmp = g_hash_table_lookup (form->fields, "capabilities");
- if (tmp == NULL)
+ if (tmp != NULL && tmp->default_value != NULL)
{
- g_free (yts_service_name);
- g_hash_table_unref (yts_name_map);
- continue;
+ yts_caps = g_strdupv (tmp->raw_value_contents);
+ }
+ else
+ {
+ gchar *caps_tmp[] = { NULL };
+ yts_caps = g_strdupv (caps_tmp);
}
-
- yts_caps = g_strdupv (tmp->raw_value_contents);
/* now build the value array and add it to the new hash table */
details = tp_value_array_build (3,