Update Meshtastic/AppIntents/SendWaypointIntent.swift

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Benjamin Faershtein 2025-06-05 08:29:03 -07:00 committed by GitHub
parent 7e0c0b8347
commit e7055a2768
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {