mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fix rare crash
This commit is contained in:
parent
9204de6e9c
commit
30bb3dcb6f
1 changed files with 5 additions and 1 deletions
|
@ -89,7 +89,11 @@ public final class SnodeAPI : NSObject {
|
|||
return Snode(address: "https://\(address)", port: UInt16(port), publicKeySet: Snode.KeySet(ed25519Key: ed25519PublicKey, x25519Key: x25519PublicKey))
|
||||
})
|
||||
// randomElement() uses the system's default random generator, which is cryptographically secure
|
||||
return snodePool.randomElement()!
|
||||
if !snodePool.isEmpty {
|
||||
return snodePool.randomElement()!
|
||||
} else {
|
||||
throw SnodeAPIError.randomSnodePoolUpdatingFailed
|
||||
}
|
||||
}
|
||||
}.done2 { snode in
|
||||
seal.fulfill(snode)
|
||||
|
|
Loading…
Reference in a new issue