1.27.4 Hotfix for nil myinfo when cycling peripherals

This commit is contained in:
Garth Vander Houwen 2021-10-27 21:36:30 -07:00
parent 261af7de4b
commit 57dfbdd2e2
2 changed files with 6 additions and 3 deletions

View file

@ -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;

View file

@ -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)");