{"record":{"id":"08664fe2984c8b47","repo":"flowable/flowable-engine","slug":"none-of-the-given-task-assignees-can-be-null-08664f","errorCode":null,"errorMessage":"None of the given task assignees can be null","messagePattern":"None of the given task assignees can be null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java","lineNumber":385,"sourceCode":"        if (orActive) {\n            currentOrQueryObject.assigneeLikeIgnoreCase = assigneeLikeIgnoreCase.toLowerCase();\n        } else {\n            this.assigneeLikeIgnoreCase = assigneeLikeIgnoreCase.toLowerCase();\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQuery taskAssigneeIds(List<String> assigneeIds) {\n        if (assigneeIds == null) {\n            throw new ActivitiIllegalArgumentException(\"Task assignee list is null\");\n        }\n        if (assigneeIds.isEmpty()) {\n            throw new ActivitiIllegalArgumentException(\"Task assignee list is empty\");\n        }\n        for (String assignee : assigneeIds) {\n            if (assignee == null) {\n                throw new ActivitiIllegalArgumentException(\"None of the given task assignees can be null\");\n            }\n        }\n\n        if (assignee != null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid query usage: cannot set both taskAssigneeIds and taskAssignee\");\n        }\n        if (assigneeLike != null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLike\");\n        }\n        if (assigneeLikeIgnoreCase != null) {\n            throw new ActivitiIllegalArgumentException(\"Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLikeIgnoreCase\");\n        }\n\n        if (orActive) {\n            currentOrQueryObject.assigneeIds = assigneeIds;\n        } else {\n            this.assigneeIds = assigneeIds;\n        }","sourceCodeStart":367,"sourceCodeEnd":403,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java#L367-L403","documentation":"Thrown by TaskQueryImpl.taskAssigneeIds(List<String>) when one of the entries in the assigneeIds list is null. Each element becomes part of an IN-clause; a null element is not a valid assignee id, so the loop validates every entry and fails fast with ActivitiIllegalArgumentException.","triggerScenarios":"Calling taskQuery.taskAssigneeIds(Arrays.asList(\"kermit\", null)) or passing a collection built from a lookup that produced null entries for unknown users.","commonSituations":"Building the id list from a map where some keys mapped to null; deserializing a JSON array containing nulls; collecting resolved user objects and forgetting to filter unresolved ones.","solutions":["Filter nulls before the call: ids.removeIf(Objects::isNull) or stream().filter(Objects::nonNull).","Validate each id in the service layer and fail with a precise message naming the offending entry.","Fix the upstream lookup so unknown users are skipped instead of yielding null.","After filtering, re-check emptiness (the empty-list check will otherwise fire next)."],"exampleFix":"// before\nList<String> ids = users.stream().map(User::getId).collect(toList()); // may contain nulls\nquery.taskAssigneeIds(ids);\n\n// after\nList<String> ids = users.stream()\n    .map(User::getId)\n    .filter(Objects::nonNull)\n    .collect(toList());\nif (!ids.isEmpty()) {\n    query.taskAssigneeIds(ids);\n}","handlingStrategy":"validation","validationCode":"List<String> cleanIds = assigneeIds == null ? Collections.emptyList()\n    : assigneeIds.stream().filter(Objects::nonNull).collect(Collectors.toList());\nif (!cleanIds.isEmpty()) {\n    query.taskAssigneeIds(cleanIds);\n}","typeGuard":"List<String> withoutNulls(List<String> l) { return l == null ? Collections.emptyList() : l.stream().filter(Objects::nonNull).collect(Collectors.toList()); }","tryCatchPattern":"try {\n    query.taskAssigneeIds(assigneeIds);\n} catch (ActivitiIllegalArgumentException e) {\n    throw new BadRequestException(\"Null assignee id in list\");\n}","preventionTips":["Filter null entries (removeIf(Objects::isNull)) before passing id lists.","Fix upstream lookups to skip unknown users rather than emitting null.","Re-check list emptiness after null filtering."],"tags":["java","flowable","task-query","null-element","assignee"],"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"}