From db1b72f95f898150626a16d35675093ea2260477 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Thu, 28 Mar 2024 01:19:13 +0100 Subject: [PATCH] Fixed back-end alert verification. --- src/alerts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/alerts.js b/src/alerts.js index 7a8c8ade..8d604261 100755 --- a/src/alerts.js +++ b/src/alerts.js @@ -11,7 +11,7 @@ async function addAlert(alert, sessionUser) { throw new HttpError('You are not authenthicated', 401); } - if (!alert.actors?.length > 0 && !alert.tags?.length > 0 && !alert.entity && !alert.matches?.length > 0) { + if ((!alert.actors || alert.actors.length === 0) && (!alert.tags || alert.tags.length === 0) && (!alert.entities || alert.entities.length === 0) && (!alert.matches || alert.matches.length === 0)) { throw new HttpError('Alert must contain at least one actor, tag or entity', 400); }