Fix Yoda conditions

This commit is contained in:
deepsource-autofix[bot]
2022-09-05 16:34:40 +00:00
committed by GitHub
parent ba325cdd63
commit 8bb219a545
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -667,7 +667,7 @@ router.post("/api/setBio", async function (req, res) {
return;
}
bio = encodeURIComponent(bio);
if (100 < bio.length) {
if (bio.length > 100) {
res.status(400);
res.json({ "error": "the bio is too long!" });
return;
@@ -736,7 +736,7 @@ router.post("/api/changeUsername", async function (req, res) {
res.json({ "error": "incorrect password" });
return;
}
if (100 < req.body.newUsername.length) {
if (req.body.newUsername.length > 100) {
res.status(400);
res.json({ "error": "username is too long" });
return;