diff options
author | Ted Gould <ted@gould.cx> | 2011-02-14 22:35:51 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-02-14 22:35:51 -0600 |
commit | 331a9b26f51f79a1c06dde2ca5c1364431e471be (patch) | |
tree | 5ce5a822ed4fe0badfd90a46eb7b4176eabd83a9 | |
parent | 3cebed3db50dd6325c725d87a6ec5eabc21d2ba3 (diff) | |
download | libdbusmenu-331a9b26f51f79a1c06dde2ca5c1364431e471be.tar.gz libdbusmenu-331a9b26f51f79a1c06dde2ca5c1364431e471be.tar.bz2 libdbusmenu-331a9b26f51f79a1c06dde2ca5c1364431e471be.zip |
Protecting from the cases of NULL variants
-rw-r--r-- | libdbusmenu-glib/server.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 4fe7bdc..ed23d16 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -680,7 +680,10 @@ prop_array_teardown (GArray * prop_array) prop_idle_prop_t * iprop = &g_array_index(iitem->array, prop_idle_prop_t, j); g_free(iprop->property); - g_variant_unref(iprop->variant); + + if (iprop->variant != NULL) { + g_variant_unref(iprop->variant); + } } g_array_free(iitem->array, TRUE); @@ -899,7 +902,9 @@ menuitem_property_changed (DbusmenuMenuitem * mi, gchar * property, GVariant * v g_array_append_val(properties, myprop); } - g_variant_ref(variant); + if (variant != NULL) { + g_variant_ref(variant); + } /* Check to see if the idle is already queued, and queue it if not. */ |