Преглед на файлове

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.");
     }