summaryrefslogtreecommitdiff
path: root/platform/ios
diff options
context:
space:
mode:
authorJesse Bounds <jesse@rebounds.net>2016-08-11 09:23:58 -0700
committerGitHub <noreply@github.com>2016-08-11 09:23:58 -0700
commitd782fc952ffacd7424479b6e905adfc2e17494bd (patch)
tree4e5bb6b93bef5837117d903b7c8a99c2010cf2f5 /platform/ios
parentc354ae523a00b4c0e0577c4784b53553ea1a1cb7 (diff)
downloadqtlocation-mapboxgl-d782fc952ffacd7424479b6e905adfc2e17494bd.tar.gz
[ios] Guard against nil data task (#5932)
Diffstat (limited to 'platform/ios')
-rw-r--r--platform/ios/src/MGLAPIClient.m4
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 {