Handle nil emoji

Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com>
This commit is contained in:
Garth Vander Houwen 2026-04-05 09:08:27 -07:00 committed by GitHub
parent c5ceca2aa8
commit 8cdccabe61

View file

@ -166,10 +166,8 @@ struct WaypointForm: View {
newWaypoint.longitudeI = waypoint.longitudeI
newWaypoint.name = name.count > 0 ? name : "Dropped Pin"
newWaypoint.description_p = description
// Unicode scalar value for the icon emoji string
let unicodeScalers = icon.unicodeScalars
// First element as an UInt32
let unicode = unicodeScalers[unicodeScalers.startIndex].value
let unicode = unicodeScalers.first?.value ?? 128205
newWaypoint.icon = unicode
if locked {
if lockedTo == 0 {