← Back to team overview

ayatana-commits team mailing list archive

[Branch ~dbusmenu-team/dbusmenu/trunk] Rev 20: Checking on error so that we don't access invalid hash tables.

 

Merge authors:
  Ted Gould (ted)
Related merge proposals:
  https://code.launchpad.net/~ted/dbusmenu/433719/+merge/12784
  proposed by: Ted Gould (ted)
  review: Approve - Neil J. Patel (njpatel)
------------------------------------------------------------
revno: 20 [merge]
committer: Ted Gould <ted@xxxxxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2009-10-02 09:13:05 -0500
message:
  Checking on error so that we don't access invalid hash tables.
modified:
  libdbusmenu-glib/client.c


--
lp:dbusmenu
https://code.launchpad.net/~dbusmenu-team/dbusmenu/trunk

Your team ayatana-commits is subscribed to branch lp:dbusmenu.
To unsubscribe from this branch go to https://code.launchpad.net/~dbusmenu-team/dbusmenu/trunk/+edit-subscription.
=== modified file 'libdbusmenu-glib/client.c'
--- libdbusmenu-glib/client.c	2009-09-21 20:38:02 +0000
+++ libdbusmenu-glib/client.c	2009-10-02 13:52:39 +0000
@@ -565,6 +565,10 @@
 static void
 menuitem_get_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * error, gpointer data)
 {
+	if (error != NULL) {
+		g_warning("Error getting properties on a menuitem: %s", error->message);
+		return;
+	}
 	g_hash_table_foreach(properties, get_properties_helper, data);
 	g_hash_table_destroy(properties);
 	return;
@@ -575,6 +579,10 @@
 static void
 menuitem_get_properties_new_cb (DBusGProxy * proxy, GHashTable * properties, GError * error, gpointer data)
 {
+	if (error != NULL) {
+		g_warning("Error getting properties on a new menuitem: %s", error->message);
+		return;
+	}
 	g_return_if_fail(data != NULL);
 
 	newItemPropData * propdata = (newItemPropData *)data;