Skip to content

Commit a50e344

Browse files
committed
Replace message wkid force unwrapping.
#534 (comment)
1 parent 63bcdd7 commit a50e344

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Shared/Samples/Apply dictionary renderer to graphics overlay/ApplyDictionaryRendererToGraphicsOverlayView.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ struct ApplyDictionaryRendererToGraphicsOverlayView: View {
7979

8080
if parser.parse() {
8181
// Creates graphics from the parsed messages.
82-
return parser.messages.map { message in
83-
let spatialReference = SpatialReference(wkid: .init(message.wkid!)!)
82+
return parser.messages.compactMap { message in
83+
guard let messageWKID = message.wkid,
84+
let wkid = WKID(messageWKID) else { return nil }
85+
let spatialReference = SpatialReference(wkid: wkid)
8486
let points = message.controlPoints.map { x, y in
8587
Point(x: x, y: y, spatialReference: spatialReference)
8688
}

0 commit comments

Comments
 (0)