diff options
author | monsta <[email protected]> | 2018-01-22 16:13:16 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2018-01-22 16:13:16 +0300 |
commit | 74c8d775840c806a84784d38560d85ec4d87fc81 (patch) | |
tree | 7a92029c2c75b70fdef9181a9e34169013625bc4 | |
parent | fd12de42dc5614b94ae330eee307fb32a35bd335 (diff) | |
download | mate-panel-74c8d775840c806a84784d38560d85ec4d87fc81.tar.bz2 mate-panel-74c8d775840c806a84784d38560d85ec4d87fc81.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
-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); |