From 72a77bdfbe9dd9925648b2cfa8b11804758def40 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 18 Jan 2011 10:38:27 -0600 Subject: Adding warnings on g_variant_parse errors --- libdbusmenu-glib/server.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 39176c2..8d18feb 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -912,7 +912,13 @@ bus_get_group_properties (DbusmenuServer * server, GVariant * params, GDBusMetho GVariant * props = dbusmenu_menuitem_properties_variant(mi); if (props == NULL) { - props = g_variant_parse(g_variant_type_new("a{sv}"), "{}", NULL, NULL, NULL); + GError * error = NULL; + props = g_variant_parse(g_variant_type_new("a{sv}"), "{}", NULL, NULL, &error); + if (error != NULL) { + g_warning("Unable to parse '{}' as a 'a{sv}'"); + g_error_free(error); + props = NULL; + } } g_variant_builder_add_value(&wbuilder, props); @@ -926,7 +932,13 @@ bus_get_group_properties (DbusmenuServer * server, GVariant * params, GDBusMetho if (builder_init) { ret = g_variant_builder_end(&builder); } else { + GError * error = NULL; ret = g_variant_parse(g_variant_type_new("a(ia(sv))"), "[]", NULL, NULL, NULL); + if (error != NULL) { + g_warning("Unable to parse '[]' as a 'a(ia(sv))'"); + g_error_free(error); + ret = NULL; + } } GVariant * final = NULL; -- cgit v1.2.3