aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-04 10:43:53 -0800
committerTed Gould <ted@gould.cx>2010-02-04 10:43:53 -0800
commita5c79e6483cda97ac21ca1a609b19bf37bfe17f3 (patch)
treef15d7676aba6c463fa1f0b7b572cc03e55fea05e /libdbusmenu-gtk
parent350e98ef479c8038a0ef3e3b1aac45730c8c906a (diff)
downloadlibdbusmenu-a5c79e6483cda97ac21ca1a609b19bf37bfe17f3.tar.gz
libdbusmenu-a5c79e6483cda97ac21ca1a609b19bf37bfe17f3.tar.bz2
libdbusmenu-a5c79e6483cda97ac21ca1a609b19bf37bfe17f3.zip
Checking for NULL value in setting the toggle setting to make sure they are set before erroring. And erroring if we don't get ints
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r--libdbusmenu-gtk/client.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c
index 555e8d2..0109a83 100644
--- a/libdbusmenu-gtk/client.c
+++ b/libdbusmenu-gtk/client.c
@@ -150,6 +150,7 @@ static void
process_toggle_type (DbusmenuMenuitem * mi, GtkMenuItem * gmi, const GValue * value)
{
if (!IS_GENERICMENUITEM(gmi)) return;
+ if (value == NULL) return;
GenericmenuitemCheckType type = GENERICMENUITEM_CHECK_TYPE_NONE;
@@ -173,6 +174,7 @@ static void
process_toggle_state (DbusmenuMenuitem * mi, GtkMenuItem * gmi, const GValue * value)
{
if (!IS_GENERICMENUITEM(gmi)) return;
+ if (value == NULL) return;
GenericmenuitemState state = GENERICMENUITEM_STATE_UNCHECKED;
@@ -184,6 +186,8 @@ process_toggle_state (DbusmenuMenuitem * mi, GtkMenuItem * gmi, const GValue * v
} else if (val == DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN) {
state = GENERICMENUITEM_STATE_INDETERMINATE;
}
+ } else {
+ g_warning("Toggle state changed without having an int");
}
genericmenuitem_set_state(GENERICMENUITEM(gmi), state);