فهرست منبع

Improved type validation

Taichi Masuyama 4 سال پیش
والد
کامیت
6426bed56e
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      packages/app/src/server/models/user-group.js

+ 2 - 2
packages/app/src/server/models/user-group.js

@@ -79,8 +79,8 @@ class UserGroup {
   }
 
   static async findChildUserGroupsByParentIds(parentIds, includeGrandChildren = false) {
-    if (parentIds == null) {
-      throw Error('parentIds must not be null.');
+    if (!Array.isArray(parentIds)) {
+      throw Error('parentIds must be an array.');
     }
 
     const childUserGroups = await this.find({ parent: { $in: parentIds } });