You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ia...@apache.org on 2014/04/04 19:11:57 UTC

[6/8] git commit: CB-6394: ios: Return ENCODING_ERR when fs name is not valid

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/dev
Commit: ff592f699c35ee3dc27f24dc785e1bf14798ed79
Parents: 37bedcb
Author: Ian Clelland <ic...@chromium.org>
Authored: Thu Apr 3 14:04:00 2014 -0400
Committer: Ian Clelland <ic...@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];
 }