CB-8296 ios: Fix crash when upload fails and file is not yet created (close #57)

This commit is contained in:
Edna Morales
2015-01-13 11:43:06 -05:00
committed by Andrew Grieve
parent 046e9ae59a
commit 6db2820258
+5 -1
View File
@@ -587,7 +587,11 @@ static CFIndex WriteDataToStream(NSData* data, CFWriteStreamRef stream)
{
NSFileManager* fileMgr = [NSFileManager defaultManager];
[fileMgr removeItemAtPath:[self targetFilePath] error:nil];
NSString *targetPath = [self targetFilePath];
if ([fileMgr fileExistsAtPath:targetPath])
{
[fileMgr removeItemAtPath:targetPath error:nil];
}
}
- (void)cancelTransfer:(NSURLConnection*)connection