{"record":{"id":"9f7ef5dea3cab7eb","repo":"flowable/flowable-engine","slug":"provided-userids-is-null","errorCode":null,"errorMessage":"Provided userIds is null","messagePattern":"Provided userIds is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/GroupQueryImpl.java","lineNumber":121,"sourceCode":"            throw new FlowableIllegalArgumentException(\"Provided type is null\");\n        }\n        this.type = type;\n        return this;\n    }\n\n    @Override\n    public GroupQuery groupMember(String userId) {\n        if (userId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided userId is null\");\n        }\n        this.userId = userId;\n        return this;\n    }\n\n    @Override\n    public GroupQuery groupMembers(List<String> userIds) {\n        if (userIds == null) {\n            throw new FlowableIllegalArgumentException(\"Provided userIds is null\");\n        }\n        this.userIds = userIds;\n        return this;\n    }\n\n    // sorting ////////////////////////////////////////////////////////\n\n    @Override\n    public GroupQuery orderByGroupId() {\n        return orderBy(GroupQueryProperty.GROUP_ID);\n    }\n\n    @Override\n    public GroupQuery orderByGroupName() {\n        return orderBy(GroupQueryProperty.NAME);\n    }\n\n    @Override","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/GroupQueryImpl.java#L103-L139","documentation":"Flowable's GroupQueryImpl.groupMembers(List<String> userIds) throws FlowableIllegalArgumentException when the userIds list is null. Criteria on the query object must be non-null; a null list cannot be translated into a SQL IN clause. The check fires at query-construction time, before any command executes.","triggerScenarios":"Calling groupMembers(null) on a GroupQuery, usually when the list was built conditionally but the call was made unconditionally, or when a nullable collection from an upstream API (e.g. user.getGroupIds()) is passed straight through.","commonSituations":"Dynamic query builders assembling filters from request DTOs with optional fields; refactors that changed a default new ArrayList to null; mapping code where an absent JSON array deserialized to null.","solutions":["Initialize the list to an empty List (Collections.emptyList()) or apply the filter only when non-null","Coalesce null upstream collections before passing them: groupMembers(ids != null ? ids : Collections.emptyList())","If you want all groups regardless of members, simply omit the groupMembers call"],"exampleFix":"// before\nGroupQuery query = identityService.createGroupQuery().groupMembers(userIds);\n// after\nGroupQuery query = identityService.createGroupQuery();\nif (userIds != null) {\n    query.groupMembers(userIds);\n}","handlingStrategy":"validation","validationCode":"if (userIds == null) { throw new IllegalArgumentException(\"userIds must not be null before groupMembers()\"); }","typeGuard":"boolean isValidUserIds(List<String> userIds) { return userIds != null; }","tryCatchPattern":"try { query.groupMembers(userIds); } catch (FlowableIllegalArgumentException e) { log.warn(\"Invalid group query: {}\", e.getMessage()); }","preventionTips":["Normalize nullable collections to empty lists before query building","Only apply collection criteria when the collection is non-null and non-empty","Deserialization: configure JSON mapping to produce empty lists instead of nulls"],"tags":["flowable","idm","query","null-check"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}