Fix crash in relay list view

Changelog-Fixed: Fix crash in relay list view
This commit is contained in:
William Casarin
2023-04-05 12:33:08 -07:00
parent 6910e84fd8
commit b9fed6e4eb
2 changed files with 4 additions and 4 deletions

View File

@@ -7,7 +7,7 @@
import Foundation
fileprivate let BOOTSTRAP_RELAYS = [
let BOOTSTRAP_RELAYS = [
"wss://relay.damus.io",
"wss://eden.nostr.land",
"wss://nostr.wine",

View File

@@ -22,9 +22,9 @@ struct RelayConfigView: View {
var recommended: [RelayDescriptor] {
let rs: [RelayDescriptor] = []
return state.bootstrap_relays.reduce(into: rs) { xs, x in
if state.pool.get_relay(x) == nil {
xs.append(RelayDescriptor(url: URL(string: x)!, info: .rw))
return BOOTSTRAP_RELAYS.reduce(into: rs) { xs, x in
if state.pool.get_relay(x) == nil, let url = URL(string: x) {
xs.append(RelayDescriptor(url: url, info: .rw))
}
}
}