From ed65902499b069aa5911c16c6afc306dbd1a34ae Mon Sep 17 00:00:00 2001 From: Steven Crader Date: Wed, 17 May 2023 23:45:04 -0700 Subject: [PATCH] Fix wrong length comparison Co-authored-by: Guilherme Dellagustin --- server/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/index.js b/server/index.js index 12846a15..44beb38f 100644 --- a/server/index.js +++ b/server/index.js @@ -133,7 +133,7 @@ app.use('/api/comments/byepisodeid', async (req, res) => { const socialInteract = response.episode.socialInteract && response.episode.socialInteract.filter((si) => si.protocol === 'activitypub'); - if(socialInteract === undefined || socialInteract.length >= 0) { + if(socialInteract === undefined || socialInteract.length === 0) { // Bad requests sounds appropriate, as the client is only expected to call this API // when it validated upfront that the episode has a property socialInteract with activitypub protocol res.status(400).send('The episode does not contain a socialInteract property')