From dfd529dfae32edfb9949e6afb89c2eb631893ea3 Mon Sep 17 00:00:00 2001 From: monsta Date: Mon, 22 Jan 2018 16:14:35 +0300 Subject: status-notifier: don't crash if tooltip has wrong type fixes the second issue mentioned in https://github.com/mate-desktop/mate-panel/issues/686 ported from: https://git.gnome.org/browse/gnome-panel/commit/?id=585c6727a807f0160e79f42a1f17350cc6df0d78 --- applets/notification_area/status-notifier/sn-item-v0.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'applets/notification_area/status-notifier') diff --git a/applets/notification_area/status-notifier/sn-item-v0.c b/applets/notification_area/status-notifier/sn-item-v0.c index f8657137..dec9bdf1 100644 --- a/applets/notification_area/status-notifier/sn-item-v0.c +++ b/applets/notification_area/status-notifier/sn-item-v0.c @@ -512,6 +512,14 @@ sn_tooltip_new (GVariant *variant) if (variant == NULL) return NULL; + if (!g_variant_is_of_type (variant, G_VARIANT_TYPE ("(sa(iiay)ss)"))) + { + g_warning ("Type for 'ToolTip' property should be '(sa(iiay)ss)' " + "but got '%s'", g_variant_get_type_string (variant)); + + return NULL; + } + g_variant_get (variant, "(&s@a(iiay)&s&s)", &icon_name, &icon_pixmap, &title, &text); -- cgit v1.2.1