diff options
-rw-r--r-- | libdbusmenu-gtk/menuitem.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libdbusmenu-gtk/menuitem.c b/libdbusmenu-gtk/menuitem.c index 57cd258..a250431 100644 --- a/libdbusmenu-gtk/menuitem.c +++ b/libdbusmenu-gtk/menuitem.c @@ -295,6 +295,9 @@ dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * ke if (wrapper == NULL) { return; } + if (!G_VALUE_HOLDS_BOXED(wrapper)) { + return; + } GValueArray * wrapperarray = (GValueArray *)g_value_get_boxed(wrapper); if (wrapperarray->n_values == 0) { @@ -306,6 +309,10 @@ dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * ke } GValue * ventryarray = g_value_array_get_nth(wrapperarray, 0); + if (!G_VALUE_HOLDS_BOXED(ventryarray)) { + return; + } + GValueArray * entryarray = (GValueArray *)g_value_get_boxed(ventryarray); if (entryarray->n_values == 0) { /* Seems a little odd, but really, we're saying that it isn't a @@ -316,6 +323,10 @@ dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * ke /* Parse through modifiers */ int i; for (i = 0; i < entryarray->n_values - 1; i++) { + if (!G_VALUE_HOLDS_STRING(g_value_array_get_nth(entryarray, i))) { + continue; + } + if (g_strcmp0(g_value_get_string(g_value_array_get_nth(entryarray, i)), DBUSMENU_MENUITEM_SHORTCUT_CONTROL) == 0) { *modifier |= GDK_CONTROL_MASK; continue; |