diff options
author | Ted Gould <ted@gould.cx> | 2011-03-07 12:19:14 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-03-07 12:19:14 -0600 |
commit | d5e89f9a0144e0df6ba0cb45a97a1a598c96d8f1 (patch) | |
tree | 63cd895deb99dcc17556b6900d2f50209da7d47a /libdbusmenu-glib/menuitem.c | |
parent | b0af2cb938c23b980bd39ec3094d6d04e0996e25 (diff) | |
download | libdbusmenu-d5e89f9a0144e0df6ba0cb45a97a1a598c96d8f1.tar.gz libdbusmenu-d5e89f9a0144e0df6ba0cb45a97a1a598c96d8f1.tar.bz2 libdbusmenu-d5e89f9a0144e0df6ba0cb45a97a1a598c96d8f1.zip |
Putting in a protection and fixing the truth
Diffstat (limited to 'libdbusmenu-glib/menuitem.c')
-rw-r--r-- | libdbusmenu-glib/menuitem.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index 950889b..2e5a345 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -1180,19 +1180,23 @@ dbusmenu_menuitem_property_set_variant (DbusmenuMenuitem * mi, const gchar * pro } } - gboolean replaced = FALSE; gboolean remove = FALSE; gchar * hash_key = NULL; GVariant * hash_variant = NULL; gboolean inhash = g_hash_table_lookup_extended(priv->properties, property, (gpointer *)&hash_key, (gpointer *)&hash_variant); + if (inhash && hash_variant == NULL) { + g_warning("The property '%s' is in the hash with a NULL variant", property); + inhash = FALSE; + } + if (value != NULL) { /* NOTE: We're only marking this as replaced if this is true but we're actually replacing it no matter. This is so that the variant passed in sticks around which the caller may expect. They shouldn't, but it's low cost to remove bugs. */ - if (inhash || !g_variant_equal(hash_variant, value)) { + if (!inhash || !g_variant_equal(hash_variant, value)) { replaced = TRUE; } |