Skip to content

Commit

Permalink
Prevent throw for second thread credentials call (#2475)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoncal authored Dec 7, 2023
1 parent 738c6ac commit cdc2f14
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ final class ThreadClientService: THClientProtocol {
let preferredCredential = try await client.preferredCredentials()

// All credentials retrieve the rest of the credentials after user acceps permission dialog
var allCredentials = try await client.allCredentials()
// This call may fail, but we don't want to throw error since preferredCredential succeeded
var allCredentials: Set<THCredentials> = (try? await client.allCredentials()) ?? []
allCredentials = allCredentials.filter { $0.borderAgentID != preferredCredential.borderAgentID }
allCredentials.insert(preferredCredential)

Expand Down

0 comments on commit cdc2f14

Please sign in to comment.