summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2018-01-22 16:14:35 +0300
committermonsta <[email protected]>2018-03-18 14:49:01 +0300
commitc2a206a3b2f425cfcb877589042695d70d087757 (patch)
tree2b92ea6059776764e3207f3fbb926abda523a392
parentf2d9039672f40065a1c288575c34340b1326f569 (diff)
downloadmate-panel-c2a206a3b2f425cfcb877589042695d70d087757.tar.bz2
mate-panel-c2a206a3b2f425cfcb877589042695d70d087757.tar.xz
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
-rw-r--r--applets/notification_area/status-notifier/sn-item-v0.c8
1 files changed, 8 insertions, 0 deletions
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);