dotnet-bluetooth-le / dotnet-bluetooth-le

Bluetooth LE plugin for Xamarin/MAUI, supporting Android, iOS, Mac, Windows
Apache License 2.0
816 stars 308 forks source link

Android uncatchable exception #511

Open iXyles opened 3 years ago

iXyles commented 3 years ago

Steps to reproduce

  1. Set the device to not have bluetooth active.

  2. Try to connect to known device.

Expected behavior

Error connection failure exception

Actual behavior

Aggregate exception because of null reference object (uncatchable) in "Device.cs" for the Android implementation

Crashlog

No call stack, since it throws an "Aggregate exception(Aggregate exception(null reference exception))" from: https://github.com/xabre/xamarin-bluetooth-le/blob/f916758de21ee316b7ef4c16b097fb99de9632e2/Source/Plugin.BLE.Android/Device.cs#L136 Because "Gatt" service is null.

Configuration

Version of the Plugin: V2.1.2

Platform: Android - no specific version.

Device: Most likely any - Tested with "OnePlus 7 Pro"

smsissuechecker commented 3 years ago

Hi @iXyles,

I'm the friendly issue checker. Thanks for using the issue template :star2: I appreciate it very much. I'm sure, the maintainers of this repository will answer, soon.