diff options
author | Ted Gould <ted@gould.cx> | 2010-02-09 10:57:49 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-09 10:57:49 -0600 |
commit | a8a90555de087915762224eaab219874b1e161d6 (patch) | |
tree | a449a89e7d8a25741df47e3cbb61eebf97ba82db /libdbusmenu-glib | |
parent | ad37b8d3493851011e585f0e342eef49f973f3b9 (diff) | |
download | libdbusmenu-a8a90555de087915762224eaab219874b1e161d6.tar.gz libdbusmenu-a8a90555de087915762224eaab219874b1e161d6.tar.bz2 libdbusmenu-a8a90555de087915762224eaab219874b1e161d6.zip |
Adding some additional checks.
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/client.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index efae0ee..40ab182 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -561,6 +561,7 @@ get_properties_helper (gpointer key, gpointer value, gpointer data) static void menuitem_get_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * error, gpointer data) { + g_return_if_fail(DBUSMENU_IS_MENUITEM(data)); if (error != NULL) { g_warning("Error getting properties on a menuitem: %s", error->message); return; @@ -646,10 +647,13 @@ menuitem_get_properties_new_cb (DBusGProxy * proxy, GHashTable * properties, GEr return; } +/* Respond to the call function to make sure that the other side + got it, or print a warning. */ static void menuitem_call_cb (DBusGProxy * proxy, GError * error, gpointer userdata) { - DbusmenuMenuitem * mi = (DbusmenuMenuitem *)userdata; + g_return_if_fail(DBUSMENU_IS_MENUITEM(userdata)); + DbusmenuMenuitem * mi = DBUSMENU_MENUITEM(userdata); if (error != NULL) { g_warning("Unable to call menu item %d: %s", dbusmenu_menuitem_get_id(mi), error->message); |