Browse Source

Fix crash on role check

denikson 6 năm trước cách đây
mục cha
commit
cab294b2ff
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      util.js

+ 1 - 1
util.js

@@ -21,7 +21,7 @@ function isValidImage(fileName) {
 function isAuthorised(member) {
     if (db.get("editors.users").includes(member.id).value())
         return true;
-    if (db.get("editors.roles").intersectionWith(member.roles.keyArray()).isEmpty().value())
+    if (member.roles.size == 0 || db.get("editors.roles").intersectionWith(member.roles.keyArray()).isEmpty().value())
         return false;
     return true;
 }