diff options
author | monsta <[email protected]> | 2018-01-22 16:13:16 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2018-03-18 14:48:34 +0300 |
commit | f2d9039672f40065a1c288575c34340b1326f569 (patch) | |
tree | a9b1dfbb323913fce95dfc961d0f9fa6ef9f3792 /applets | |
parent | e2ccace3958c8e375df4b1cb381556329707e7c3 (diff) | |
download | mate-panel-f2d9039672f40065a1c288575c34340b1326f569.tar.bz2 mate-panel-f2d9039672f40065a1c288575c34340b1326f569.tar.xz |
status-notifier: don't crash if menu layout has wrong type
fixes https://github.com/mate-desktop/mate-panel/issues/686
ported from:
https://git.gnome.org/browse/gnome-panel/commit/?id=a08f238147660b3d70e5eebd8d24707711424719
Diffstat (limited to 'applets')
-rw-r--r-- | applets/notification_area/status-notifier/sn-dbus-menu.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/applets/notification_area/status-notifier/sn-dbus-menu.c b/applets/notification_area/status-notifier/sn-dbus-menu.c index 855c2569..28633990 100644 --- a/applets/notification_area/status-notifier/sn-dbus-menu.c +++ b/applets/notification_area/status-notifier/sn-dbus-menu.c @@ -126,6 +126,15 @@ layout_parse (SnDBusMenu *menu, GVariantIter iter; GVariant *child; + if (!g_variant_is_of_type (layout, G_VARIANT_TYPE ("(ia{sv}av)"))) + { + g_warning ("Type of return value for 'layout' property in " + "'GetLayout' call should be '(ia{sv}av)' but got '%s'", + g_variant_get_type_string (layout)); + + return; + } + g_variant_get (layout, "(i@a{sv}@av)", &id, &props, &items); submenu = layout_update_item (menu, gtk_menu, id, props); |