diff --git a/lib/providers/connection_provider.dart b/lib/providers/connection_provider.dart index c284d37..086e50c 100644 --- a/lib/providers/connection_provider.dart +++ b/lib/providers/connection_provider.dart @@ -848,10 +848,21 @@ class ConnectionProvider with ChangeNotifier { return true; } catch (e) { debugPrint('❌ [Provider] Failed to check slot $channelIdx: $e'); + if (_isEmptyChannelQueryError(e)) { + debugPrint( + ' ℹ️ Treating slot $channelIdx as empty because the device reported it was not found', + ); + return true; + } return false; } } + bool _isEmptyChannelQueryError(Object error) { + final message = error.toString().toLowerCase(); + return message.contains('not found'); + } + Future findNextEmptyChannelSlot() async { if (!_activeService.isConnected) { throw Exception('Not connected to device');