From 32084b0e06e21a510d080e3e699416153b215026 Mon Sep 17 00:00:00 2001 From: kotontrion Date: Mon, 17 Feb 2025 09:52:03 +0100 Subject: tray: add small check to prevent segfault when tray app does not follow the spec correctly. There probably should be more though. --- lib/tray/trayItem.vala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/tray/trayItem.vala b/lib/tray/trayItem.vala index f753cd0..cd13f8b 100644 --- a/lib/tray/trayItem.vala +++ b/lib/tray/trayItem.vala @@ -217,7 +217,8 @@ public class TrayItem : Object { } }); - if (proxy.Menu != null) { + Variant? menuVariant = proxy.get_cached_property("Menu"); + if (proxy.Menu != null && menuVariant != null && menuVariant.is_of_type(VariantType.SIGNATURE)) { this.menu_importer = new DBusMenu.Importer(proxy.get_name_owner(), proxy.Menu); this.menu_importer.notify["model"].connect(() => { notify_property("menu-model"); -- cgit v1.2.3