From 4cb96b827ab0f5768bc8cd0a8ca2a62ebaec5722 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Fri, 27 Jan 2023 09:04:05 -0800 Subject: [PATCH] Fix share location crash if a device is not connected --- Meshtastic/Views/Settings/AppSettings.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Meshtastic/Views/Settings/AppSettings.swift b/Meshtastic/Views/Settings/AppSettings.swift index 9e2a2af7..b0802fb9 100644 --- a/Meshtastic/Views/Settings/AppSettings.swift +++ b/Meshtastic/Views/Settings/AppSettings.swift @@ -103,7 +103,10 @@ struct AppSettings: View { self.bleManager.context = context } .onChange(of: userSettings.provideLocation) { newProvideLocation in - self.bleManager.sendWantConfig() + + if bleManager.connectedPeripheral != nil { + self.bleManager.sendWantConfig() + } } } }