Skip to content

Commit

Permalink
fix(ios): app crashes when error happens in fetching location (#11273)
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaysingh-axway authored and ssaddique committed Oct 14, 2019
1 parent 4aa8604 commit 6100379
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions iphone/Classes/GeolocationModule.m
Expand Up @@ -1086,11 +1086,12 @@ - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLoca

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
NSMutableDictionary *event = [TiUtils dictionaryWithCode:[error code] message:[TiUtils messageFromError:error]];

if ([self _hasListeners:@"location"]) {
[self fireEvent:@"location" withObject:nil errorCode:[error code] message:[TiUtils messageFromError:error]];
[self fireEvent:@"location" withDict:event];
}

NSMutableDictionary *event = [TiUtils dictionaryWithCode:[error code] message:[TiUtils messageFromError:error]];
BOOL recheck = [self fireSingleShotLocationIfNeeded:event stopIfNeeded:NO];
recheck = recheck || [self fireSingleShotHeadingIfNeeded:event stopIfNeeded:NO];

Expand Down

0 comments on commit 6100379

Please sign in to comment.