cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject cordova-plugin-file-transfer git commit: CB-8296 ios: Fix crash when upload fails and file is not yet created (close #57)
Date Wed, 14 Jan 2015 01:25:05 GMT
Repository: cordova-plugin-file-transfer
Updated Branches:
  refs/heads/master 046e9ae59 -> 6db282025


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


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/commit/6db28202
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/tree/6db28202
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/diff/6db28202

Branch: refs/heads/master
Commit: 6db2820258c922789a8c44decc80e9d9958aef4f
Parents: 046e9ae
Author: Edna Morales <edna592@gmail.com>
Authored: Tue Jan 13 11:43:06 2015 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Jan 13 20:24:28 2015 -0500

----------------------------------------------------------------------
 src/ios/CDVFileTransfer.m | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/blob/6db28202/src/ios/CDVFileTransfer.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVFileTransfer.m b/src/ios/CDVFileTransfer.m
index a1eeef2..167a611 100644
--- a/src/ios/CDVFileTransfer.m
+++ b/src/ios/CDVFileTransfer.m
@@ -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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message