Skip to content

Commit

Permalink
add check for exception when forgetting gear
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed Dec 6, 2024
1 parent 8ef494a commit 1f33419
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Backend/Bluetooth/bluetooth_manager_plus.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Future<void> initFlutterBluePlus(InitFlutterBluePlusRef ref) async {
}
}
// if the forget button was used, remove the device
if (knownDevices[bluetoothDevice.remoteId.str]!.forgetOnDisconnect) {
if (knownDevices[bluetoothDevice.remoteId.str] != null && knownDevices[bluetoothDevice.remoteId.str]!.forgetOnDisconnect) {
_bluetoothPlusLogger.finer('forgetting about gear');
ref.read(knownDevicesProvider.notifier).remove(bluetoothDevice.remoteId.str);
}
Expand Down

0 comments on commit 1f33419

Please sign in to comment.