Fix possible error with relay hints

This commit is contained in:
Bojan Mojsilovic 2024-04-04 12:24:22 +02:00
parent c19a24e1a5
commit 237991a681

View File

@ -445,6 +445,7 @@ export const sendEvent = async (event: NostrEvent, relays: Relay[], relaySetting
const hintRelayUrls = event.tags.reduce((acc, t) => { const hintRelayUrls = event.tags.reduce((acc, t) => {
if ( if (
t[0] === 'e' && t[0] === 'e' &&
t[2] &&
t[2].length > 0 && t[2].length > 0 &&
!relays.find(r => r.url === t[2]) !relays.find(r => r.url === t[2])
) { ) {