mirror of
https://github.com/apache/cordova-plugin-file-transfer.git
synced 2026-04-28 00:02:49 +08:00
CB-8296 ios: Fix crash when upload fails and file is not yet created (close #57)
This commit is contained in:
committed by
Andrew Grieve
parent
046e9ae59a
commit
6db2820258
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user