fix path building crash
This commit is contained in:
parent
e73fe4fe31
commit
6bc0177bd4
|
@ -204,7 +204,11 @@ public enum OnionRequestAPI {
|
||||||
} else {
|
} else {
|
||||||
return buildPaths(reusing: []).map2 { paths in
|
return buildPaths(reusing: []).map2 { paths in
|
||||||
if let snode = snode {
|
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 {
|
} else {
|
||||||
return paths.randomElement()!
|
return paths.randomElement()!
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue