Skip to content

Make failure block optional#13

Open
junlee-qz wants to merge 1 commit intokubatruhlar:masterfrom
junlee-qz:jun/nullableblocks
Open

Make failure block optional#13
junlee-qz wants to merge 1 commit intokubatruhlar:masterfrom
junlee-qz:jun/nullableblocks

Conversation

@junlee-qz
Copy link

@junlee-qz junlee-qz commented Aug 17, 2022

Some how

- (NSURLSessionDataTask *)requestUrlWithRetryRemaining:(NSInteger)retryRemaining maxRetry:(NSInteger)maxRetry retryInterval:(NSTimeInterval)retryInterval progressive:(bool)progressive fatalStatusCodes:(NSArray<NSNumber *> *)fatalStatusCodes originalRequestCreator:(NSURLSessionDataTask *(^)(void (^)(NSURLSessionDataTask *, NSError *)))taskCreator originalFailure:(void(^)(NSURLSessionDataTask *task, NSError *))failure {

method doesn't specify originalFailure block as nullable which can cause crashes if we pass null

Original methods from AFNetworking take nullable blocks.
ex) https://github.com/AFNetworking/AFNetworking/blob/master/AFNetworking/AFHTTPSessionManager.m#L125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant