From e7055a2768285c6c0996760066a490a4f3076360 Mon Sep 17 00:00:00 2001 From: Benjamin Faershtein <119711889+RCGV1@users.noreply.github.com> Date: Thu, 5 Jun 2025 08:29:03 -0700 Subject: [PATCH] Update Meshtastic/AppIntents/SendWaypointIntent.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Meshtastic/AppIntents/SendWaypointIntent.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Meshtastic/AppIntents/SendWaypointIntent.swift b/Meshtastic/AppIntents/SendWaypointIntent.swift index e41732db..fb0f97c3 100644 --- a/Meshtastic/AppIntents/SendWaypointIntent.swift +++ b/Meshtastic/AppIntents/SendWaypointIntent.swift @@ -89,7 +89,11 @@ struct SendWaypointIntent: AppIntent { } if isLocked { - newWaypoint.lockedTo = UInt32(BLEManager.shared.connectedPeripheral!.num) + if let connectedPeripheral = BLEManager.shared.connectedPeripheral { + newWaypoint.lockedTo = UInt32(connectedPeripheral.num) + } else { + throw AppIntentErrors.AppIntentError.notConnected + } } if !BLEManager.shared.sendWaypoint(waypoint: newWaypoint) {