Do not register dbus notification if message failed to be sent out
because transport was already disconnected
---
plugins/bluez5.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/plugins/bluez5.c b/plugins/bluez5.c
index 979076e..e72e352 100644
--- a/plugins/bluez5.c
+++ b/plugins/bluez5.c
@@ -155,8 +155,10 @@ void bt_unregister_profile(DBusConnection *conn, const char *object)
return;
}
- dbus_pending_call_set_notify(c, unregister_profile_cb, NULL, NULL);
- dbus_pending_call_unref(c);
+ if (c) {
+ dbus_pending_call_set_notify(c, unregister_profile_cb, NULL, NULL);
+ dbus_pending_call_unref(c);
+ }
dbus_message_unref(msg);
}
--
2.5.5
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0,
www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928