Kaynağa Gözat

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

Pouria Ezzati 1 yıl önce
ebeveyn
işleme
b2fb713462
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  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.");
     }