{"record":{"id":"0c5f35b83a4c78d0","repo":"flowable/flowable-engine","slug":"task-name-list-is-null","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/HistoricTaskInstanceQueryImpl.java","lineNumber":739,"sourceCode":"            this.taskIds = taskIds;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricTaskInstanceQuery taskName(String taskName) {\n        if (inOrStatement) {\n            this.currentOrQueryObject.taskName = taskName;\n        } else {\n            this.taskName = taskName;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricTaskInstanceQuery taskNameIn(Collection<String> taskNameList) {\n        if (taskNameList == null) {\n            throw new FlowableIllegalArgumentException(\"Task name list is null\");\n        }\n        if (taskNameList.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"Task name list is empty\");\n        }\n\n        if (taskName != null) {\n            throw new FlowableIllegalArgumentException(\"Invalid query usage: cannot set both taskNameIn and taskName\");\n        }\n        if (taskNameLike != null) {\n            throw new FlowableIllegalArgumentException(\"Invalid query usage: cannot set both taskNameIn and taskNameLike\");\n        }\n        if (taskNameLikeIgnoreCase != null) {\n            throw new FlowableIllegalArgumentException(\"Invalid query usage: cannot set both taskNameIn and taskNameLikeIgnoreCase\");\n        }\n\n        if (inOrStatement) {\n            currentOrQueryObject.taskNameList = taskNameList;\n        } else {","sourceCodeStart":721,"sourceCodeEnd":757,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/HistoricTaskInstanceQueryImpl.java#L721-L757","documentation":"HistoricTaskInstanceQueryImpl.taskNameIn(Collection) throws FlowableIllegalArgumentException when the taskNameList collection is null. The names are bound into the query's IN clause, which requires a concrete list of strings. Flowable rejects the null argument immediately at query construction.","triggerScenarios":"Calling historicTaskInstanceQuery().taskNameIn(null), usually when the name list originates from an uninitialized variable, a null-returning service, or an unset configuration value.","commonSituations":"Optional task-name filter feature whose backing list was never set; REST handler passing through a missing request parameter as null; cache/lookup miss returning null.","solutions":["Initialize the collection before calling taskNameIn.","Guard the call with a null/empty check and skip it when no names are configured.","Have the producing code return an empty list rather than null, and skip the call on empty."],"exampleFix":"// before\nquery.taskNameIn(names); // may be null\n// after\nif (names != null && !names.isEmpty()) {\n    query.taskNameIn(names);\n}","handlingStrategy":"validation","validationCode":"if (taskNameList == null || taskNameList.isEmpty()) {\n    throw new IllegalArgumentException(\"taskNameIn requires a non-empty list\");\n}","typeGuard":"boolean hasNames(Collection<String> names) {\n    return names != null && !names.isEmpty();\n}","tryCatchPattern":"try {\n    query.taskNameIn(names);\n} catch (FlowableIllegalArgumentException e) {\n    logger.warn(\"Invalid task name list: {}\", e.getMessage());\n}","preventionTips":["Map missing request parameters to empty lists, then skip the filter when empty.","Apply @NonNull annotations on builder methods that feed taskNameIn.","Guard optional filters behind a single conditional before query construction."],"tags":["flowable","query-builder","null-argument","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"}