소스 검색

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

Dominik Hadl 9 년 전
부모
커밋
a48ce144c4
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  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)")
                     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]()
                     var credential = [String: String]()
                     if let server = credentials[AttributeServer] as? String {
                     if let server = credentials[AttributeServer] as? String {
                         credential["server"] = server
                         credential["server"] = server