From 331a9b26f51f79a1c06dde2ca5c1364431e471be Mon Sep 17 00:00:00 2001
From: Ted Gould <ted@gould.cx>
Date: Mon, 14 Feb 2011 22:35:51 -0600
Subject: Protecting from the cases of NULL variants

---
 libdbusmenu-glib/server.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'libdbusmenu-glib')

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. */
-- 
cgit v1.2.3