File tree Expand file tree Collapse file tree
Buttplug.Server.Managers.UWPBluetoothManager Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,9 +58,15 @@ public UWPBluetoothManager(IButtplugLogManager aLogManager)
5858 private async void OnAdvertisementReceived ( BluetoothLEAdvertisementWatcher aObj ,
5959 BluetoothLEAdvertisementReceivedEventArgs aEvent )
6060 {
61- var advertName = aEvent . Advertisement . LocalName ;
61+ if ( aEvent == null || aEvent . Advertisement == null )
62+ {
63+ BpLogger . Debug ( "Null BLE advertisement recieved: skipping" ) ;
64+ return ;
65+ }
66+
67+ var advertName = aEvent . Advertisement . LocalName ?? string . Empty ;
6268 var advertGUIDs = new List < Guid > ( ) ;
63- advertGUIDs . AddRange ( aEvent . Advertisement . ServiceUuids ) ;
69+ advertGUIDs . AddRange ( aEvent . Advertisement . ServiceUuids ?? new Guid [ ] { } ) ;
6470 var btAddr = aEvent . BluetoothAddress ;
6571
6672 // BpLogger.Trace($"Got BLE Advertisement for device: {aEvent.Advertisement.LocalName} / {aEvent.BluetoothAddress}");
You can’t perform that action at this time.
0 commit comments