Переглянути джерело

fix reading malicious_attempts count: it's already a number so no nead to get its length

Pouria Ezzati 1 рік тому
батько
коміт
b2fb713462
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      server/handlers/validators.handler.js

+ 1 - 1
server/handlers/validators.handler.js

@@ -396,7 +396,7 @@ async function malware(user, target) {
     );
 
     // Ban if too many cooldowns
-    if (updatedUser.malicious_attempts.length > 2) {
+    if (updatedUser.malicious_attempts > 2) {
       await query.user.update({ id: user.id }, { banned: true });
       throw new utils.CustomError("Too much malware requests. You are now banned.");
     }