aboutsummaryrefslogtreecommitdiff
path: root/mottovote/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'mottovote/index.js')
-rw-r--r--mottovote/index.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/mottovote/index.js b/mottovote/index.js
index 73c1641..9ef3d62 100644
--- a/mottovote/index.js
+++ b/mottovote/index.js
@@ -11,7 +11,7 @@ app.get("/api/list", checkUser, async (req, res) => {
for (const vote of votes) {
const mid = mottos.findIndex((motto) => motto.id === vote.motto_id);
- if (mid !== undefined) mottos[mid].votes = vote.votes;
+ if (mid >= 0) mottos[mid].votes = vote.votes;
}
res.json(mottos);
});