aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-01-18 10:38:27 -0600
committerTed Gould <ted@gould.cx>2011-01-18 10:38:27 -0600
commit72a77bdfbe9dd9925648b2cfa8b11804758def40 (patch)
treea5c540b0206f399eebe60e2ed0fa18bd2dd1ce5b
parent4c8f8ca605bb7e2780c089c42ca58e8c0c7aa7dd (diff)
downloadlibdbusmenu-72a77bdfbe9dd9925648b2cfa8b11804758def40.tar.gz
libdbusmenu-72a77bdfbe9dd9925648b2cfa8b11804758def40.tar.bz2
libdbusmenu-72a77bdfbe9dd9925648b2cfa8b11804758def40.zip
Adding warnings on g_variant_parse errors
-rw-r--r--libdbusmenu-glib/server.c14
1 files changed, 13 insertions, 1 deletions
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;