Skip to content

Commit

Permalink
Fix wrong length comparison
Browse files Browse the repository at this point in the history
Co-authored-by: Guilherme Dellagustin <[email protected]>
  • Loading branch information
stevencrader and dellagustin authored May 18, 2023
1 parent 6b3636a commit ed65902
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit ed65902

Please sign in to comment.