mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
fix path building crash
This commit is contained in:
parent
e73fe4fe31
commit
6bc0177bd4
1 changed files with 5 additions and 1 deletions
|
@ -204,7 +204,11 @@ public enum OnionRequestAPI {
|
|||
} else {
|
||||
return buildPaths(reusing: []).map2 { paths in
|
||||
if let snode = snode {
|
||||
return paths.filter { !$0.contains(snode) }.randomElement()!
|
||||
if let path = paths.filter({ !$0.contains(snode) }).randomElement() {
|
||||
return path
|
||||
} else {
|
||||
throw Error.insufficientSnodes
|
||||
}
|
||||
} else {
|
||||
return paths.randomElement()!
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue