bluetooth: there may be no active local device

Which leads again to a NULL dereference.

Change-Id: I6da9d7cc59de8b75aaacaa5103a762a7b929b675
Reviewed-on: https://review.haiku-os.org/c/haiku/+/11264
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Máximo Castañeda
2026-07-16 18:24:54 +00:00
committed by waddlesplash
parent 364a11897d
commit 42b8b3c5b7
+4 -1
View File
@@ -42,10 +42,13 @@ RemoteDevice::IsTrustedDevice(void)
BObjectList<RemoteDevice>
RemoteDevice::GetRemoteDevices(LocalDevice* localDevice)
{
BMessage requestRemoteDevices(BT_MSG_GET_REMOTE_DEVICES);
BObjectList<RemoteDevice> rdList;
if (localDevice == NULL)
return rdList;
BMessage devices;
BMessage requestRemoteDevices(BT_MSG_GET_REMOTE_DEVICES);
requestRemoteDevices.AddInt32("hci_id", localDevice->ID());
if (BMessenger(BLUETOOTH_SIGNATURE).SendMessage(&requestRemoteDevices,
&devices) != B_OK)