diff options
Diffstat (limited to 'platform/ios')
-rw-r--r-- | platform/ios/src/MGLAPIClient.m | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/ios/src/MGLAPIClient.m b/platform/ios/src/MGLAPIClient.m index fb13113c81..b9b0dc17cc 100644 --- a/platform/ios/src/MGLAPIClient.m +++ b/platform/ios/src/MGLAPIClient.m @@ -63,7 +63,9 @@ static NSString * const MGLAPIClientHTTPMethodPost = @"POST"; 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 { |