Skip to content

Commit 8abf09d

Browse files
authored
perform nil check before clearing geofences (#409)
1 parent 8c85b76 commit 8abf09d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

RadarSDK/RadarLocationManager.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,14 +511,14 @@ - (void)removeBubbleGeofence {
511511
}
512512

513513
- (void)replaceSyncedGeofences:(NSArray<RadarGeofence *> *)geofences {
514-
[self removeSyncedGeofences];
515-
516514
if (!geofences) {
517515
[[RadarLogger sharedInstance] logWithLevel:RadarLogLevelDebug message:@"Skipping replacing synced geofences"];
518516

519517
return;
520518
}
521519

520+
[self removeSyncedGeofences];
521+
522522
RadarTrackingOptions *options = [Radar getTrackingOptions];
523523
NSUInteger numGeofences = MIN(geofences.count, options.beacons ? 9 : 19);
524524
NSMutableArray *requests = [NSMutableArray array];

0 commit comments

Comments
 (0)