We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ee2f61 commit 70b1727Copy full SHA for 70b1727
MapboxGeocoder/MBGeocoder.swift
@@ -306,7 +306,9 @@ public class Geocoder: NSObject {
306
userInfo[NSLocalizedFailureReasonErrorKey] = failureReason ?? userInfo[NSLocalizedFailureReasonErrorKey] ?? NSHTTPURLResponse.localizedStringForStatusCode(error?.code ?? -1)
307
userInfo[NSLocalizedRecoverySuggestionErrorKey] = recoverySuggestion ?? userInfo[NSLocalizedRecoverySuggestionErrorKey]
308
}
309
- userInfo[NSUnderlyingErrorKey] = error
+ if let error = error {
310
+ userInfo[NSUnderlyingErrorKey] = error
311
+ }
312
return NSError(domain: error?.domain ?? MBGeocoderErrorDomain, code: error?.code ?? -1, userInfo: userInfo)
313
314
0 commit comments