From 322edc9e0d11eaf04850d157f12afbec8cc96249 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Sun, 12 Feb 2023 20:11:50 -0800 Subject: [PATCH] Fix share channels crash --- Meshtastic/Views/Settings/ShareChannels.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Meshtastic/Views/Settings/ShareChannels.swift b/Meshtastic/Views/Settings/ShareChannels.swift index da2655ec..79d91a28 100644 --- a/Meshtastic/Views/Settings/ShareChannels.swift +++ b/Meshtastic/Views/Settings/ShareChannels.swift @@ -288,7 +288,7 @@ struct ShareChannels: View { loRaConfig.usePreset = node?.loRaConfig?.usePreset ?? true loRaConfig.channelNum = UInt32(node?.loRaConfig?.channelNum ?? 0) channelSet.loraConfig = loRaConfig - if node != nil && node?.myInfo != nil { + if node?.myInfo?.channels != nil && node?.myInfo?.channels?.count ?? 0 > 0 { for ch in node!.myInfo!.channels!.array as! [ChannelEntity] { if ch.role > 0 {