{"record":{"id":"0921c8167d0d0830","repo":"flowable/flowable-engine","slug":"assignee-is-null-0921c8","errorCode":null,"errorMessage":"Assignee is null","messagePattern":"Assignee 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":430,"sourceCode":"    }\n\n    @Override\n    public TaskQuery taskMaxPriority(Integer maxPriority) {\n        if (maxPriority == null) {\n            throw new FlowableIllegalArgumentException(\"Max Priority is null\");\n        }\n        if (orActive) {\n            currentOrQueryObject.maxPriority = maxPriority;\n        } else {\n            this.maxPriority = maxPriority;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQueryImpl taskAssignee(String assignee) {\n        if (assignee == null) {\n            throw new FlowableIllegalArgumentException(\"Assignee is null\");\n        }\n        if (orActive) {\n            currentOrQueryObject.assignee = assignee;\n        } else {\n            this.assignee = assignee;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQueryImpl taskAssigneeLike(String assigneeLike) {\n        if (assigneeLike == null) {\n            throw new FlowableIllegalArgumentException(\"AssigneeLike is null\");\n        }\n        if (orActive) {\n            currentOrQueryObject.assigneeLike = assigneeLike;\n        } else {\n            this.assigneeLike = assigneeLike;","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java#L412-L448","documentation":"TaskQueryImpl.taskAssignee(String) rejects a null assignee with FlowableIllegalArgumentException. Assignee is an exact-match filter on the task assignee column; null is not treated as 'unassigned' (use taskWithoutAssignee() semantics instead), so the method fails fast.","triggerScenarios":"Calling taskAssignee(null), e.g. forwarding an optional 'assignedTo' request parameter or a user-context variable that is null for anonymous users.","commonSituations":"'My tasks' pages where the current user id is null; API clients omitting the assignee parameter; migration code where the assignee field was removed upstream.","solutions":["Skip the assignee criterion when the value is null (build the query conditionally).","If unassigned tasks are meant, do not call taskAssignee at all — omit the filter (or use the unassigned variants).","Resolve/validate the current user id before query construction and fail earlier with a clearer message.","Catch FlowableIllegalArgumentException at the boundary and return 400."],"exampleFix":"// before\nquery.taskAssignee(currentUserId); // null for anonymous\n// after\nif (currentUserId != null) {\n    query.taskAssignee(currentUserId);\n}","handlingStrategy":"validation","validationCode":"if (assignee != null) {\n    query.taskAssignee(assignee);\n}","typeGuard":"boolean hasAssignee(String a) { return a != null && !a.isEmpty(); }","tryCatchPattern":"try {\n    query.taskAssignee(assignee);\n} catch (FlowableIllegalArgumentException e) {\n    throw new BadRequestException(\"assignee filter must not be null\", e);\n}","preventionTips":["Resolve the current user before query building; reject anonymous contexts earlier with a clearer error.","Remember null assignee is NOT 'unassigned tasks' — omit the filter or use candidate/unassigned APIs.","Filter out blank strings from request parameters before applying criteria.","Centralize assignee handling in a query-builder utility."],"tags":["flowable","task-query","null-argument","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"}