From f148914ed8af113031401176ba1d7669582ba11e Mon Sep 17 00:00:00 2001 From: Yonle Date: Sat, 2 Mar 2024 17:42:02 +0700 Subject: [PATCH] bouncer: handle error on missing config field for blocked_publishers Signed-off-by: Yonle --- bouncer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bouncer.js b/bouncer.js index 9a70fc6..b2251c6 100644 --- a/bouncer.js +++ b/bouncer.js @@ -71,7 +71,7 @@ module.exports = (ws, req, onClose) => { if (!authorized) return; if (!validateEvent(data[1])) return ws.send(JSON.stringify(["NOTICE", "error: invalid event"])); if (data[1].kind == 22242) return ws.send(JSON.stringify(["OK", data[1].id, false, "rejected: kind 22242"])); - if (blocked_publishers.includes(data[1].pubkey)) return ws.send(JSON.stringify(["OK", data[1].id, false, "blocked: you are in the bouncer blocklist."])); + if (blocked_publishers?.includes(data[1].pubkey)) return ws.send(JSON.stringify(["OK", data[1].id, false, "blocked: you are in the bouncer blocklist."])); if ( approved_publishers?.length &&