CB-6010: ios: Test filesystem plugins for presence of optional URLforFilesystemPath before calling
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/f24abdd9 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/f24abdd9 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/f24abdd9 Branch: refs/heads/master Commit: f24abdd94df624c51dfaf1a9cc73c44a8bde0eb3 Parents: 6b7f6e9 Author: Ian Clelland <[email protected]> Authored: Tue Feb 11 11:56:56 2014 -0500 Committer: Ian Clelland <[email protected]> Committed: Tue Feb 11 14:11:23 2014 -0500 ---------------------------------------------------------------------- RELEASENOTES.md | 1 + src/ios/CDVFile.m | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/f24abdd9/RELEASENOTES.md ---------------------------------------------------------------------- diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 0ef23df..6fbdff7 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -127,3 +127,4 @@ ### 1.0.1 * CB-5959: Entry.getMetadata should return size attribute +* CB-6010: Test properly for presence of URLforFilesystemPath method http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/f24abdd9/src/ios/CDVFile.m ---------------------------------------------------------------------- diff --git a/src/ios/CDVFile.m b/src/ios/CDVFile.m index 39234e5..a4347bc 100644 --- a/src/ios/CDVFile.m +++ b/src/ios/CDVFile.m @@ -268,9 +268,12 @@ NSString* const kCDVFilesystemURLPrefix = @"cdvfile"; // Try all installed filesystems, in order. If any one supports mapping from // path to URL, and returns a URL, then use it. for (id object in self.fileSystems) { - localURL = [object URLforFilesystemPath:localPath]; - if (localURL) + if ([object respondsToSelector:@selector(URLforFilesystemPath:)]) { + localURL = [object URLforFilesystemPath:localPath]; + } + if (localURL) { return localURL; + } } return nil; }
