cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject [25/37] git commit: CB-6394: ios: Return ENCODING_ERR when fs name is not valid
Date Wed, 23 Apr 2014 18:57:21 GMT
CB-6394: ios: Return ENCODING_ERR when fs name is not valid


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

Branch: refs/heads/master
Commit: ff592f699c35ee3dc27f24dc785e1bf14798ed79
Parents: 37bedcb
Author: Ian Clelland <iclelland@chromium.org>
Authored: Thu Apr 3 14:04:00 2014 -0400
Committer: Ian Clelland <iclelland@chromium.org>
Committed: Fri Apr 4 13:11:11 2014 -0400

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


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/ff592f69/src/ios/CDVFile.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVFile.m b/src/ios/CDVFile.m
index e87e7dc..f4cbf30 100644
--- a/src/ios/CDVFile.m
+++ b/src/ios/CDVFile.m
@@ -439,7 +439,11 @@ NSString* const kCDVFilesystemURLPrefix = @"cdvfile";
         result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:ENCODING_ERR];
     } else {
         NSObject<CDVFileSystem> *fs = [self filesystemForURL:inputURI];
-        result = [fs entryForLocalURI:inputURI];
+        if (fs == nil) {
+            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:ENCODING_ERR];
+        } else {
+            result = [fs entryForLocalURI:inputURI];
+        }
     }
     [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
 }


Mime
View raw message