From 8c2304cdfeeca71075807b64ca14cc986927369f Mon Sep 17 00:00:00 2001 From: Mattt Thompson Date: Mon, 16 Jan 2012 14:32:44 -0800 Subject: [PATCH] [Issue #158] [Issue #163] Fixing error check in appendPartWithFileURL:name:error:. Looking at the documentation for NSURLConnection +sendSynchronousRequest:returningResponse:error:, we don't really need to check error to do the right thing. Therefore, we can get away with checking data and response, and leaving the inclusion of the specified **error as an optional exercise to the user --- AFNetworking/AFHTTPClient.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AFNetworking/AFHTTPClient.m b/AFNetworking/AFHTTPClient.m index 22bf41e..32f2dbc 100644 --- a/AFNetworking/AFHTTPClient.m +++ b/AFNetworking/AFHTTPClient.m @@ -475,7 +475,7 @@ static inline NSString * AFMultipartFormFinalBoundary() { NSURLResponse *response = nil; NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:error]; - if (response && !error) { + if (data && response) { [self appendPartWithFileData:data name:name fileName:[response suggestedFilename] mimeType:[response MIMEType]]; return YES;