Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios] Guard against nil data task (#5932)
Browse files Browse the repository at this point in the history
  • Loading branch information
boundsj authored and friedbunny committed Oct 26, 2016
1 parent 3924507 commit 0a1d984
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion platform/ios/src/MGLAPIClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ - (void)postEvents:(nonnull NS_ARRAY_OF(MGLMapboxEventAttributes *) *)events com
dataTask = nil;
}];
[dataTask resume];
[self.dataTasks addObject:dataTask];
if (dataTask) {
[self.dataTasks addObject:dataTask];
}
}

- (void)postEvent:(nonnull MGLMapboxEventAttributes *)event completionHandler:(nullable void (^)(NSError * _Nullable error))completionHandler {
Expand Down

0 comments on commit 0a1d984

Please sign in to comment.