You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2016/05/19 17:18:37 UTC
[04/40] usergrid git commit: Fixed bug with UsergridAsset init with
fileUrl.
Fixed bug with UsergridAsset init with fileUrl.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/f2a4a103
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/f2a4a103
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/f2a4a103
Branch: refs/heads/master
Commit: f2a4a10300b08c52efdbb6f98982d86e48dd119d
Parents: 684faa9
Author: Robert Walsh <rj...@gmail.com>
Authored: Tue Feb 16 15:52:56 2016 -0600
Committer: Robert Walsh <rj...@gmail.com>
Committed: Tue Feb 16 15:52:56 2016 -0600
----------------------------------------------------------------------
sdks/swift/Source/UsergridAsset.swift | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/f2a4a103/sdks/swift/Source/UsergridAsset.swift
----------------------------------------------------------------------
diff --git a/sdks/swift/Source/UsergridAsset.swift b/sdks/swift/Source/UsergridAsset.swift
index 3f74796..85f9ab6 100644
--- a/sdks/swift/Source/UsergridAsset.swift
+++ b/sdks/swift/Source/UsergridAsset.swift
@@ -122,7 +122,7 @@ public class UsergridAsset: NSObject, NSCoding {
- returns: A new instance of `UsergridAsset` if the data can be gathered from the passed in `NSURL`, otherwise nil.
*/
public convenience init?(fileName:String? = UsergridAsset.DEFAULT_FILE_NAME, fileURL:NSURL, contentType:String? = nil) {
- if fileURL.isFileReferenceURL(), let assetData = NSData(contentsOfURL: fileURL) {
+ if fileURL.fileURL, let assetData = NSData(contentsOfURL: fileURL) {
var fileNameToUse = fileName
if fileNameToUse != UsergridAsset.DEFAULT_FILE_NAME, let inferredFileName = fileURL.lastPathComponent {
fileNameToUse = inferredFileName