From a2b9c3367eccef6d2135292b5609adb600df25ef Mon Sep 17 00:00:00 2001 From: Wes Zheng Date: Tue, 20 Feb 2018 16:05:55 -0800 Subject: [PATCH] Add thread safety protection for taskTable write operation --- ios/RNFetchBlobNetwork.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ios/RNFetchBlobNetwork.m b/ios/RNFetchBlobNetwork.m index 7be57fc59..8c75febcf 100644 --- a/ios/RNFetchBlobNetwork.m +++ b/ios/RNFetchBlobNetwork.m @@ -241,7 +241,10 @@ - (void) sendRequest:(__weak NSDictionary * _Nullable )options } __block NSURLSessionDataTask * task = [session dataTaskWithRequest:req]; - [taskTable setObject:task forKey:taskId]; + @synchronized(taskTable) + { + [taskTable setObject:task forKey:taskId]; + } [task resume]; // network status indicator