aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-03-22 16:22:22 -0500
committerTed Gould <ted@gould.cx>2011-03-22 16:22:22 -0500
commitf3616aa2137f519baf175649fafd2f83ae169830 (patch)
treef846a03bd050689109bb7f784a9a717467b497b8 /libdbusmenu-glib
parenta7c1e6c502cdc834617c59d157a3b787a5e8b0c7 (diff)
downloadlibdbusmenu-f3616aa2137f519baf175649fafd2f83ae169830.tar.gz
libdbusmenu-f3616aa2137f519baf175649fafd2f83ae169830.tar.bz2
libdbusmenu-f3616aa2137f519baf175649fafd2f83ae169830.zip
Protect against NULL properties
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r--libdbusmenu-glib/client.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index 825f3cb..fbf7621 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -1372,18 +1372,20 @@ menuitem_get_properties_replace_cb (GVariant * properties, GError * error, gpoin
GList * current_props = dbusmenu_menuitem_properties_list(DBUSMENU_MENUITEM(data));
GList * tmp = NULL;
- GVariantIter iter;
- g_variant_iter_init(&iter, properties);
- gchar * name; GVariant * value;
-
- /* Remove the entries from the current list that we have new
- values for. This way we don't create signals of them being
- removed with the duplication of the value being changed. */
- while (g_variant_iter_loop(&iter, "{sv}", &name, &value) && have_error == FALSE) {
- for (tmp = current_props; tmp != NULL; tmp = g_list_next(tmp)) {
- if (g_strcmp0((gchar *)tmp->data, name) == 0) {
- current_props = g_list_delete_link(current_props, tmp);
- break;
+ if (properties != NULL) {
+ GVariantIter iter;
+ g_variant_iter_init(&iter, properties);
+ gchar * name; GVariant * value;
+
+ /* Remove the entries from the current list that we have new
+ values for. This way we don't create signals of them being
+ removed with the duplication of the value being changed. */
+ while (g_variant_iter_loop(&iter, "{sv}", &name, &value) && have_error == FALSE) {
+ for (tmp = current_props; tmp != NULL; tmp = g_list_next(tmp)) {
+ if (g_strcmp0((gchar *)tmp->data, name) == 0) {
+ current_props = g_list_delete_link(current_props, tmp);
+ break;
+ }
}
}
}