Fix crash

pull/208/head
nielsandriesse 5 years ago
parent 5652c20c8b
commit d5f411232c

@ -146,9 +146,11 @@ public enum OnionRequestAPI {
let storage = OWSPrimaryStorage.shared() let storage = OWSPrimaryStorage.shared()
storage.dbReadConnection.read { transaction in storage.dbReadConnection.read { transaction in
paths = storage.getOnionRequestPaths(in: transaction) paths = storage.getOnionRequestPaths(in: transaction)
if paths.count >= pathCount {
guardSnodes.formUnion([ paths[0][0], paths[1][0] ]) guardSnodes.formUnion([ paths[0][0], paths[1][0] ])
} }
} }
}
// randomElement() uses the system's default random generator, which is cryptographically secure // randomElement() uses the system's default random generator, which is cryptographically secure
if paths.count >= pathCount { if paths.count >= pathCount {
return Promise<Path> { seal in return Promise<Path> { seal in

Loading…
Cancel
Save