diff --git a/src/device.c b/src/device.c
index b581564..b410a63 100644
--- a/src/device.c
+++ b/src/device.c
GSList *l, *uuids = NULL;
if (status) {
- DBusMessage *reply;
- reply = btd_error_failed(req->msg, att_ecode2str(status));
- g_dbus_send_message(req->conn, reply);
+ if (req->msg) {
+ DBusMessage *reply;
+ reply = btd_error_failed(req->msg,
+ att_ecode2str(status));
+ g_dbus_send_message(req->conn, reply);
+ }
goto done;
}
g_slist_free(uuids);
services_changed(device);
- create_device_reply(device, req);
+ if (req->msg)
+ create_device_reply(device, req);
store_services(device);