{"record":{"id":"57ac96a284af151e","repo":"flowable/flowable-engine","slug":"task-assignee-list-is-null-57ac96","errorCode":null,"errorMessage":"Task assignee list is null","messagePattern":"Task assignee list is 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":469,"sourceCode":"    }\n\n    @Override\n    public TaskQuery taskAssigneeLikeIgnoreCase(String assigneeLikeIgnoreCase) {\n        if (assigneeLikeIgnoreCase == null) {\n            throw new FlowableIllegalArgumentException(\"assigneeLikeIgnoreCase is null\");\n        }\n        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(Collection<String> assigneeIds) {\n        if (assigneeIds == null) {\n            throw new FlowableIllegalArgumentException(\"Task assignee list is null\");\n        }\n        if (assigneeIds.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"Task assignee list is empty\");\n        }\n        for (String assignee : assigneeIds) {\n            if (assignee == null) {\n                throw new FlowableIllegalArgumentException(\"None of the given task assignees can be null\");\n            }\n        }\n\n        if (assignee != null) {\n            throw new FlowableIllegalArgumentException(\"Invalid query usage: cannot set both taskAssigneeIds and taskAssignee\");\n        }\n        if (assigneeLike != null) {\n            throw new FlowableIllegalArgumentException(\"Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLike\");\n        }\n        if (assigneeLikeIgnoreCase != null) {\n            throw new FlowableIllegalArgumentException(\"Invalid query usage: cannot set both taskAssigneeIds and taskAssigneeLikeIgnoreCase\");","sourceCodeStart":451,"sourceCodeEnd":487,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java#L451-L487","documentation":"TaskQueryImpl.taskAssigneeIds(Collection<String>) rejects a null collection before building the query. Flowable validates query inputs eagerly so invalid filters fail at query construction rather than producing an empty or broken SQL query. Throwing FlowableIllegalArgumentException here surfaces the programming mistake immediately at the call site.","triggerScenarios":"Calling taskQuery.taskAssigneeIds(null) — typically when the assignee collection is a variable that was never initialized or a method returned null instead of an empty list.","commonSituations":"Assignee IDs fetched from an external service or config map returning null; a nullable method parameter forwarded straight into the query builder; refactoring from taskAssignee(String) to taskAssigneeIds(Collection) without null-checking the new argument.","solutions":["Ensure the collection passed to taskAssigneeIds is non-null; initialize it to Collections.emptyList() or a real list at declaration.","If the caller legitimately has no assignees, skip calling taskAssigneeIds instead of passing null.","Guard with an early null check before building the query and choose an alternative filter path."],"exampleFix":"// before\ntaskQuery.taskAssigneeIds(userService.getAssigneeIds(userId));\n\n// after\nList<String> assigneeIds = userService.getAssigneeIds(userId);\nif (assigneeIds != null && !assigneeIds.isEmpty()) {\n    taskQuery.taskAssigneeIds(assigneeIds);\n}","handlingStrategy":"validation","validationCode":"if (assigneeIds == null) { throw new IllegalArgumentException(\"assigneeIds required\"); }\ntaskQuery.taskAssigneeIds(assigneeIds);","typeGuard":"boolean usable = assigneeIds != null;","tryCatchPattern":"try {\n    taskQuery.taskAssigneeIds(assigneeIds);\n} catch (FlowableIllegalArgumentException e) {\n    if (!\"Task assignee list is null\".equals(e.getMessage())) throw e;\n    logger.warn(\"No assignee IDs supplied; building unfiltered query\", e);\n}","preventionTips":["Initialize collections at declaration instead of leaving them null.","Never let producer methods return null collections; return empty lists.","Validate inputs at the boundary of your service layer before building Flowable queries."],"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"}