{"record":{"id":"97782ef70b339c08","repo":"flowable/flowable-engine","slug":"involved-groups-are-null-97782e","errorCode":null,"errorMessage":"Involved groups are null","messagePattern":"Involved groups are null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java","lineNumber":606,"sourceCode":"    }\n\n    @Override\n    public TaskQueryImpl taskInvolvedUser(String involvedUser) {\n        if (involvedUser == null) {\n            throw new FlowableIllegalArgumentException(\"Involved user is null\");\n        }\n        if (orActive) {\n            currentOrQueryObject.involvedUser = involvedUser;\n        } else {\n            this.involvedUser = involvedUser;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQueryImpl taskInvolvedGroups(Collection<String> involvedGroups) {\n        if (involvedGroups == null) {\n            throw new FlowableIllegalArgumentException(\"Involved groups are null\");\n        }\n        if (involvedGroups.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"Involved groups are empty\");\n        }\n        if (orActive) {\n            currentOrQueryObject.involvedGroups = involvedGroups;\n        } else {\n            this.involvedGroups = involvedGroups;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQueryImpl taskCandidateGroup(String candidateGroup) {\n        if (candidateGroup == null) {\n            throw new FlowableIllegalArgumentException(\"Candidate group is null\");\n        }\n","sourceCodeStart":588,"sourceCodeEnd":624,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java#L588-L624","documentation":"TaskQueryImpl.taskInvolvedGroups() throws this when the passed collection is null. The query API requires an explicit, populated collection to filter tasks by involved groups; a null cannot be translated into a query criterion. Fail-fast validation avoids downstream database errors.","triggerScenarios":"Calling taskQuery.taskInvolvedGroups(null), e.g. when group ids come from a service call that returned null or an unset collection field.","commonSituations":"Group list fetched from an external identity provider returned null; collection field never initialized; conditional logic forgot to populate groups before querying.","solutions":["Pass a non-null collection of group ids to taskInvolvedGroups().","Guard with a null check and skip the filter when groups are unavailable.","Initialize the collection (e.g. Collections.emptyList()) at its source, but note empty is also rejected by a separate error.","Fix the provider that returns null groups."],"exampleFix":"// before\nTaskQuery query = taskService.createTaskQuery().taskInvolvedGroups(groups);\n// after\nTaskQuery query = taskService.createTaskQuery();\nif (groups != null && !groups.isEmpty()) {\n    query = query.taskInvolvedGroups(groups);\n}","handlingStrategy":"validation","validationCode":"if (involvedGroups == null) {\n    throw new IllegalArgumentException(\"involvedGroups must be non-null before taskInvolvedGroups()\");\n}\nquery.taskInvolvedGroups(involvedGroups);","typeGuard":"boolean isValidGroupCollection(Collection<String> g) { return g != null && !g.isEmpty(); }","tryCatchPattern":"try {\n    query.taskInvolvedGroups(groups);\n} catch (FlowableIllegalArgumentException e) {\n    logger.warn(\"Invalid task query: {}\", e.getMessage());\n    query = taskService.createTaskQuery();\n}","preventionTips":["Return empty collections (never null) from group-resolution code","Guard collections for null and emptiness before filter calls","Skip optional filters conditionally","Test query builders with null/empty group collections"],"tags":["flowable","task-query","null-argument","validation"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}