Browse Source

Fix issue with casting an optional CFArray to Swift array in shared web credentials

Dominik Hadl 9 years ago
parent
commit
a48ce144c4
1 changed files with 3 additions and 2 deletions
  1. 3 2
      Lib/KeychainAccess/Keychain.swift

+ 3 - 2
Lib/KeychainAccess/Keychain.swift

@@ -870,8 +870,9 @@ public class Keychain {
                     print("error:[\(remoteError!.code)] \(remoteError!.localizedDescription)")
                 }
             }
-            if let credentials = credentials as? [[String: AnyObject]] {
-                let credentials = credentials.map { credentials -> [String: String] in
+            if let credentials = credentials {
+                let casted = credentials as NSArray
+                let credentials = casted.map { credentials -> [String: String] in
                     var credential = [String: String]()
                     if let server = credentials[AttributeServer] as? String {
                         credential["server"] = server