Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Commit

Permalink
fix null value
Browse files Browse the repository at this point in the history
  • Loading branch information
devfd committed Jun 19, 2015
1 parent 35b6511 commit 07a008f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions RNGeocoder/RNGeocoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,19 @@ - (NSArray *)placemarksToDictionary:(NSArray *)placemarks {
CLPlacemark* placemark = [placemarks objectAtIndex:i];

NSDictionary *result = @{
@"name": placemark.name,
@"name": placemark.name ?: [NSNull null],
@"location": @{
@"lat": [NSNumber numberWithDouble:placemark.location.coordinate.latitude],
@"lng": [NSNumber numberWithDouble:placemark.location.coordinate.longitude],
},
@"country": placemark.country,
@"locality": placemark.locality,
@"subLocality": placemark.subLocality,
@"thoroughfare": placemark.thoroughfare,
@"subThoroughfare": placemark.subThoroughfare,
@"postalCode": placemark.postalCode,
@"administrativeArea": placemark.administrativeArea,
@"subAdministrativeArea": placemark.subAdministrativeArea,
@"country": placemark.country ?: [NSNull null],
@"locality": placemark.locality ?: [NSNull null],
@"subLocality": placemark.subLocality ?: [NSNull null],
@"thoroughfare": placemark.thoroughfare ?: [NSNull null],
@"subThoroughfare": placemark.subThoroughfare ?: [NSNull null],
@"postalCode": placemark.postalCode ?: [NSNull null],
@"administrativeArea": placemark.administrativeArea ?: [NSNull null],
@"subAdministrativeArea": placemark.subAdministrativeArea ?: [NSNull null],
};

[results addObject:result];
Expand Down

0 comments on commit 07a008f

Please sign in to comment.