{"record":{"id":"4e75b2c52009d511","repo":"flowable/flowable-engine","slug":"task-name-is-null-4e75b2","errorCode":null,"errorMessage":"Task name is null","messagePattern":"Task name is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java","lineNumber":239,"sourceCode":"    }\n\n    @Override\n    public TaskQuery taskIds(Collection<String> taskIds) {\n        if (taskIds == null) {\n            throw new FlowableIllegalArgumentException(\"Task ids are null\");\n        }\n        if (orActive) {\n            currentOrQueryObject.taskIds = taskIds;\n        } else {\n            this.taskIds = taskIds;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQueryImpl taskName(String name) {\n        if (name == null) {\n            throw new FlowableIllegalArgumentException(\"Task name is null\");\n        }\n\n        if (orActive) {\n            currentOrQueryObject.name = name;\n        } else {\n            this.name = name;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQuery taskNameIn(Collection<String> nameList) {\n        if (nameList == null) {\n            throw new FlowableIllegalArgumentException(\"Task name list is null\");\n        }\n        if (nameList.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"Task name list is empty\");\n        }","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java#L221-L257","documentation":"Flowable throws this FlowableIllegalArgumentException when TaskQuery.taskName(null) is called. The name filter requires a concrete value for the SQL equality predicate, so null is rejected at build time. This is an argument-validation failure, not a query-execution failure.","triggerScenarios":"Calling createTaskQuery().taskName(null), usually when the name comes from an unpopulated variable, config value, or optional request parameter.","commonSituations":"Search screens where the name filter is optional but passed straight through; property files where the expected task name key is missing; beans built before their name field was set.","solutions":["Null-check the name and omit the taskName filter when absent.","Provide a default task name value in configuration if the filter is required.","Validate the request parameter at the boundary before building the query.","If partial matching was intended, use taskNameLike with a validated non-null pattern."],"exampleFix":"// before\nquery.taskName(filter.getName()); // throws when name is null\n// after\nif (filter.getName() != null) {\n    query.taskName(filter.getName());\n}","handlingStrategy":"validation","validationCode":"if (name != null) {\n    query.taskName(name);\n}","typeGuard":"boolean isNotBlank(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try {\n    query.taskName(name);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().equals(\"Task name is null\")) {\n        throw new BadRequestException(\"task name filter must not be null\", e);\n    }\n    throw e;\n}","preventionTips":["Treat optional filters as optional: only apply them when non-null","Supply defaults for required task-name configuration keys","Validate filter DTOs before query construction","Distinguish 'no filter' from 'filter by null' explicitly in your API"],"tags":["flowable","query-builder","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"}