aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdbusmenu-glib/server.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c
index aa39991..de8a9b9 100644
--- a/libdbusmenu-glib/server.c
+++ b/libdbusmenu-glib/server.c
@@ -892,7 +892,9 @@ menuitem_property_changed (DbusmenuMenuitem * mi, gchar * property, GVariant * v
/* If so, we need to swap the value */
if (prop != NULL) {
- g_variant_unref(prop->variant);
+ if (prop->variant != NULL) {
+ g_variant_unref(prop->variant);
+ }
prop->variant = variant;
} else {
/* else we need to add it */