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); }