Diff between 71e8b70208698d4feca7eee8a4ca202bed763e06 and aba4963982789c74a5c7efbc048a0a693503ca41

Changed Files

File Additions Deletions Status
src/event.c +4 -2 modified

Full Patch

diff --git a/src/event.c b/src/event.c
index 06f33d3..113a2b6 100644
--- a/src/event.c
+++ b/src/event.c
@@ -510,7 +510,8 @@ void btd_event_device_blocked(bdaddr_t *local, bdaddr_t *peer)
 	if (!get_adapter_and_device(local, peer, &adapter, &device, FALSE))
 		return;
 
-	device_block(conn, device, TRUE);
+	if (device)
+		device_block(conn, device, TRUE);
 }
 
 void btd_event_device_unblocked(bdaddr_t *local, bdaddr_t *peer)
@@ -523,7 +524,8 @@ void btd_event_device_unblocked(bdaddr_t *local, bdaddr_t *peer)
 	if (!get_adapter_and_device(local, peer, &adapter, &device, FALSE))
 		return;
 
-	device_unblock(conn, device, FALSE, TRUE);
+	if (device)
+		device_unblock(conn, device, FALSE, TRUE);
 }
 
 void btd_event_device_unpaired(bdaddr_t *local, bdaddr_t *peer)