mapbox / MapboxGeocoder.swift

Address search and reverse geocoding in Swift or Objective-C on iOS, macOS, tvOS, and watchOS
https://www.mapbox.com/geocoding/
ISC License
131 stars 48 forks source link

Crash in MapboxGeocoder: nil qualifiedName - Line 485 #222

Open tpigramVZ opened 5 months ago

tpigramVZ commented 5 months ago

Xcode Version : 15.3 iPhone OS: iOS 17.2.1 IPhone Model: iPhone XS Max MapboxGeocoder Version: ~0.15 MapboxSearch: >= 2.0.0-rc.3, < 2.0 MapboxMaps: ~> 11.3.0

When attempting to reverse geocode using a CLLocationCoordinate2D, it is crashing when force unwrapping "qulifiedName"

let options = ReverseGeocodeOptions(coordinate: point)
let geoCoder = Geocoder(accessToken: <access token>)
geoCoder.geocode(options) { placemarks, attribution, error in
    guard let placemark = placemarks?.first else { return }
    dump(placemark)
}

MapboxGeocoder/MBPlacemark.swift:485: Fatal error: Unexpectedly found nil while unwrapping an Optional value