From 4910b98ae366a449e75cf5405e533e9e85207efc Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 8 Dec 2021 16:22:33 +0100 Subject: lib: Add debug to adapter's "notify" callback --- lib/bluetooth-client.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c index d73eb4bc..bdc136cf 100644 --- a/lib/bluetooth-client.c +++ b/lib/bluetooth-client.c @@ -484,9 +484,18 @@ adapter_notify_cb (Adapter1 *adapter, const char *default_adapter_path; adapter_path = g_dbus_proxy_get_object_path (G_DBUS_PROXY (adapter)); + if (client->default_adapter == NULL) { + g_debug ("Property '%s' changed on adapter '%s', but default adapter not set yet", + property, adapter_path); + return; + } + default_adapter_path = g_dbus_proxy_get_object_path (G_DBUS_PROXY (client->default_adapter)); - if (g_strcmp0 (default_adapter_path, adapter_path) != 0) + if (g_strcmp0 (default_adapter_path, adapter_path) != 0) { + g_debug ("Ignoring property '%s' change on non-default adapter %s", + property, adapter_path); return; + } g_debug ("Property '%s' changed on default adapter '%s'", property, adapter_path); -- cgit v1.2.1