diff options
author | Jesse Bounds <jesse@rebounds.net> | 2016-08-11 09:23:58 -0700 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2016-10-25 22:42:06 -0700 |
commit | 0a1d9849fa82f0ebd86b4960d363997bc7d3b896 (patch) | |
tree | 052f3cfe60735db7e13615ff977d87a7cb75252b | |
parent | 392450786d3bd66f426ae55c115bcbf00115dff6 (diff) | |
download | qtlocation-mapboxgl-0a1d9849fa82f0ebd86b4960d363997bc7d3b896.tar.gz |
[ios] Guard against nil data task (#5932)
-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 { |