From 57dfbdd2e20d6b01ebddaeccdd397e1546c6264c Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Wed, 27 Oct 2021 21:36:30 -0700 Subject: [PATCH] 1.27.4 Hotfix for nil myinfo when cycling peripherals --- Meshtastic Client.xcodeproj/project.pbxproj | 4 ++-- MeshtasticClient/Helpers/BLEManager.swift | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Meshtastic Client.xcodeproj/project.pbxproj b/Meshtastic Client.xcodeproj/project.pbxproj index c7beaeec..f295c628 100644 --- a/Meshtastic Client.xcodeproj/project.pbxproj +++ b/Meshtastic Client.xcodeproj/project.pbxproj @@ -672,7 +672,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.27.3; + MARKETING_VERSION = 1.27.4; PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTS_MACCATALYST = YES; @@ -699,7 +699,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.27.3; + MARKETING_VERSION = 1.27.4; PRODUCT_BUNDLE_IDENTIFIER = gvh.MeshtasticClient; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTS_MACCATALYST = YES; diff --git a/MeshtasticClient/Helpers/BLEManager.swift b/MeshtasticClient/Helpers/BLEManager.swift index f0952681..bea36862 100644 --- a/MeshtasticClient/Helpers/BLEManager.swift +++ b/MeshtasticClient/Helpers/BLEManager.swift @@ -174,7 +174,10 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph let peripheralIndex = peripherals.firstIndex(where: { $0.id == newPeripheral.id }) if peripheralIndex != nil { - newPeripheral.myInfo = self.meshData.nodes[peripheralIndex!].myInfo + + if self.meshData.nodes[peripheralIndex!].myInfo != nil { + newPeripheral.myInfo = self.meshData.nodes[peripheralIndex!].myInfo + } peripherals.remove(at: peripheralIndex!) peripherals.append(newPeripheral) print("Updating peripheral: \(peripheralName)");