ui/dbus: fix warning for clients without "Interfaces" property
The "Interfaces" property is not strictly required. We can just assume the peer doesn't implement the given interface. Fix warning: GLib: g_strv_contains: assertion 'strv != NULL' failed Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Marc-André Lureau committed
Apr 22, 2026 at 17:19 UTC
c879a576808442c2b173a8ee297611bd1bbbf24a
1 file changed
+3
-1
ui/dbus-listener.c
+3
-1
@@ -1026,9 +1026,11 @@ static bool
1026
dbus_display_listener_implements(DBusDisplayListener *ddl, const char *iface)
1027
{
1028
QemuDBusDisplay1Listener *l = QEMU_DBUS_DISPLAY1_LISTENER(ddl->proxy);
1029
+ const char * const *interfaces;
1030
bool implements;
1031
1031
- implements = g_strv_contains(qemu_dbus_display1_listener_get_interfaces(l), iface);
1032
+ interfaces = qemu_dbus_display1_listener_get_interfaces(l);
1033
+ implements = interfaces && g_strv_contains(interfaces, iface);
1034
if (!implements) {
1035
g_debug("Display listener does not implement: `%s`", iface);
1036
}