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

[ios] Guard against nil data task #5932

Merged
merged 1 commit into from
Aug 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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