[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

This commit is contained in:
Mattt Thompson 2012-01-16 14:32:44 -08:00
parent 1822d164d7
commit 8c2304cdfe

View file

@ -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;