bluetooth: Fix check if transport exists before acquire

The transport might have disapeared exactly before acquiring, so we
should avoid an assertion failure, in this case inside the function
pa_bluetooth_discovery_get_by_path().
This commit is contained in:
Mikel Astiz 2012-08-31 12:50:59 +02:00 committed by Arun Raghavan
parent 76248fd8f2
commit 0ee5fa6377

View file

@ -327,6 +327,11 @@ static int bt_transport_acquire(struct userdata *u, pa_bool_t start) {
const char *accesstype = "rw"; const char *accesstype = "rw";
const pa_bluetooth_transport *t; const pa_bluetooth_transport *t;
if (u->transport == NULL) {
pa_log("Transport no longer available.");
return -1;
}
if (bt_transport_is_acquired(u)) { if (bt_transport_is_acquired(u)) {
if (start) if (start)
goto done; goto done;