{"record":{"id":"170c72447e1d4929","repo":"flowable/flowable-engine","slug":"task-name-list-is-null-170c72","errorCode":null,"errorMessage":"Task name list is null","messagePattern":"Task name list 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":253,"sourceCode":"\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        }\n        for (String name : nameList) {\n            if (name == null) {\n                throw new FlowableIllegalArgumentException(\"None of the given task names can be null\");\n            }\n        }\n\n        if (name != null) {\n            throw new FlowableIllegalArgumentException(\"Invalid query usage: cannot set both taskNameIn and name\");\n        }\n        if (nameLike != null) {\n            throw new FlowableIllegalArgumentException(\"Invalid query usage: cannot set both taskNameIn and nameLike\");\n        }\n        if (nameLikeIgnoreCase != null) {\n            throw new FlowableIllegalArgumentException(\"Invalid query usage: cannot set both taskNameIn and nameLikeIgnoreCase\");","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java#L235-L271","documentation":"Flowable throws this FlowableIllegalArgumentException when TaskQuery.taskNameIn(null) is called. The IN-filter needs a non-null collection to produce a valid SQL IN clause, so a null list is rejected immediately during query construction.","triggerScenarios":"Calling createTaskQuery().taskNameIn(null), typically when the name collection originates from an unset field, a failed lookup, or an unvalidated method argument.","commonSituations":"Report/dashboard queries where the list of candidate names was never populated; code paths where an upstream service returned null instead of an empty list.","solutions":["Null-check the collection before calling taskNameIn and skip the filter (or throw a clear error) when null.","Pass an empty list only if you also guard against the related empty-list error - better to omit the filter entirely.","Make the producer of the collection initialize it to an empty list instead of null.","Validate the input collection at the service boundary with Objects.requireNonNull and a meaningful message."],"exampleFix":"// before\nquery.taskNameIn(names); // throws when names == null\n// after\nif (names != null && !names.isEmpty()) {\n    query.taskNameIn(names);\n}","handlingStrategy":"validation","validationCode":"if (names == null || names.isEmpty()) {\n    // skip filter or throw\n} else {\n    query.taskNameIn(names);\n}","typeGuard":"boolean isNonEmpty(Collection<?> c) { return c != null && !c.isEmpty(); }","tryCatchPattern":"try {\n    query.taskNameIn(names);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().equals(\"Task name list is null\")) {\n        throw new BadRequestException(\"name list must not be null\", e);\n    }\n    throw e;\n}","preventionTips":["Make producers return empty lists rather than null","Guard both null and empty before applying IN filters","Validate list-typed request fields with @NotNull/@Size(min=1) where a list is required","Centralize IN-filter construction with the guards in one place"],"tags":["flowable","query-builder","null-argument","collection"],"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"}