From 1f3341992118f6b224946c4c44fa37e1e90b2c27 Mon Sep 17 00:00:00 2001 From: Codel1417 Date: Thu, 5 Dec 2024 20:13:51 -0500 Subject: [PATCH] add check for exception when forgetting gear --- lib/Backend/Bluetooth/bluetooth_manager_plus.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Backend/Bluetooth/bluetooth_manager_plus.dart b/lib/Backend/Bluetooth/bluetooth_manager_plus.dart index 6f50eb87..13190270 100644 --- a/lib/Backend/Bluetooth/bluetooth_manager_plus.dart +++ b/lib/Backend/Bluetooth/bluetooth_manager_plus.dart @@ -180,7 +180,7 @@ Future 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); }