From d51b8887ee54fbac25cd158096db58e7bb093597 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 7 Jul 2025 10:46:57 -0500 Subject: [PATCH] Update Meshtastic/Helpers/BLEManager.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Meshtastic/Helpers/BLEManager.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Meshtastic/Helpers/BLEManager.swift b/Meshtastic/Helpers/BLEManager.swift index 78a58ce9..2cfc90dd 100644 --- a/Meshtastic/Helpers/BLEManager.swift +++ b/Meshtastic/Helpers/BLEManager.swift @@ -812,7 +812,9 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate moduleConfig(config: decodedInfo.moduleConfig, context: context, nodeNum: Int64(truncatingIfNeeded: self.connectedPeripheral?.num ?? 0), nodeLongName: self.connectedPeripheral?.longName ?? "Unknown") if decodedInfo.moduleConfig.payloadVariant == ModuleConfig.OneOf_PayloadVariant.cannedMessage(decodedInfo.moduleConfig.cannedMessage) { if decodedInfo.moduleConfig.cannedMessage.enabled { - _ = self.getCannedMessageModuleMessages(destNum: self.connectedPeripheral?.num ?? 0, wantResponse: true) + if let validNum = self.connectedPeripheral?.num, validNum > 0 { + _ = self.getCannedMessageModuleMessages(destNum: validNum, wantResponse: true) + } } } }