{"record":{"id":"d10e5a65742a4d21","repo":"flowable/flowable-engine","slug":"provided-groupids-is-null","errorCode":null,"errorMessage":"Provided groupIds is null","messagePattern":"Provided groupIds is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/UserQueryImpl.java","lineNumber":222,"sourceCode":"            throw new FlowableIllegalArgumentException(\"Provided emailLike is null\");\n        }\n        this.emailLike = emailLike;\n        return this;\n    }\n\n    @Override\n    public UserQuery memberOfGroup(String groupId) {\n        if (groupId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided groupId is null\");\n        }\n        this.groupId = groupId;\n        return this;\n    }\n\n    @Override\n    public UserQuery memberOfGroups(List<String> groupIds) {\n        if (groupIds == null) {\n            throw new FlowableIllegalArgumentException(\"Provided groupIds is null\");\n        }\n        this.groupIds = groupIds;\n        return this;\n    }\n\n    @Override\n    public UserQuery tenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new FlowableIllegalArgumentException(\"TenantId is null\");\n        }\n        this.tenantId = tenantId;\n        return this;\n    }\n\n    // sorting //////////////////////////////////////////////////////////\n\n    @Override\n    public UserQuery orderByUserId() {","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/UserQueryImpl.java#L204-L240","documentation":"UserQueryImpl.memberOfGroups(List<String>) throws FlowableIllegalArgumentException when the groupIds list reference is null. The engine distinguishes 'no filter' from 'filter by a null list' and rejects the latter. Pass a populated (or at least non-null) list of group ids.","triggerScenarios":"Calling identityService.createUserQuery().memberOfGroups(null); typically when the list itself was never initialized.","commonSituations":"Collecting candidate groups from process variables or role mappings; the variable is unset so the List reference is null rather than empty.","solutions":["Pass a non-null List<String> of group ids (an empty list is acceptable if supported; otherwise check size first).","Guard: if (groupIds != null && !groupIds.isEmpty()) query = query.memberOfGroups(groupIds);","Initialize the collection with Collections.emptyList() instead of leaving it null."],"exampleFix":"// before\nquery.memberOfGroups(candidateGroups); // candidateGroups may be null\n// after\nif (candidateGroups != null && !candidateGroups.isEmpty()) {\n    query = query.memberOfGroups(candidateGroups);\n}","handlingStrategy":"validation","validationCode":"if (groupIds != null && !groupIds.isEmpty()) { query = query.memberOfGroups(groupIds); }","typeGuard":"boolean hasGroups(java.util.List<String> ids) { return ids != null && !ids.isEmpty(); }","tryCatchPattern":"try { query.memberOfGroups(groupIds); } catch (FlowableIllegalArgumentException e) { log.warn(\"Null groupIds ignored\", e); }","preventionTips":["Initialize collections to empty lists instead of null","Distinguish 'no groups provided' (skip filter) from 'filter by these groups'","Sanitize data read from process variables before use"],"tags":["flowable","idm","null-argument","query","group"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}