Skip to content

Commit 6bbde07

Browse files
author
Achyut Kumar M
committed
fix to avoid crash on clicking user location
1 parent 78782aa commit 6bbde07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

GoInfoGame/GoInfoGame/UI/Map/CustomMap.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ struct CustomMap: UIViewRepresentable {
153153
if let annotation = annotation as? MKClusterAnnotation {
154154
let displayAnnotation = annotation.memberAnnotations.first as! DisplayUnitAnnotation
155155
selectedAnAnnotation(selectedQuest: displayAnnotation)
156-
} else {
157-
selectedAnAnnotation(selectedQuest: annotation as! DisplayUnitAnnotation)
156+
} else if let annotation = annotation as? DisplayUnitAnnotation {
157+
selectedAnAnnotation(selectedQuest: annotation)
158158
}
159159

160160
// Deselect the annotation to prevent re-adding on selection

0 commit comments

Comments
 (0)