{"record":{"id":"8db03587b631a1f6","repo":"flowable/flowable-engine","slug":"none-of-the-given-task-categories-can-be-null","errorCode":null,"errorMessage":"None of the given task categories can be null","messagePattern":"None of the given task categories can be 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":1848,"sourceCode":"        checkTaskCategoryList(taskCategoryNotInList);\n        if (inOrStatement) {\n            currentOrQueryObject.categoryNotInList = taskCategoryNotInList;\n        } else {\n            this.categoryNotInList = taskCategoryNotInList;\n        }\n        return this;\n    }\n\n    protected void checkTaskCategoryList(Collection<String> taskCategoryInList) {\n        if (taskCategoryInList == null) {\n            throw new FlowableIllegalArgumentException(\"Task category list is null\");\n        }\n        if (taskCategoryInList.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"Task category list is empty\");\n        }\n        for (String processCategory : taskCategoryInList) {\n            if (processCategory == null) {\n                throw new FlowableIllegalArgumentException(\"None of the given task categories can be null\");\n            }\n        }\n    }\n\n    @Override\n    public HistoricTaskInstanceQuery taskWithoutCategory() {\n        if (inOrStatement) {\n            currentOrQueryObject.withoutCategory = true;\n        } else {\n            this.withoutCategory = true;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricTaskInstanceQuery taskWithFormKey() {\n        if (inOrStatement) {\n            currentOrQueryObject.withFormKey = true;","sourceCodeStart":1830,"sourceCodeEnd":1866,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/HistoricTaskInstanceQueryImpl.java#L1830-L1866","documentation":"Collection-element validation in HistoricTaskInstanceQueryImpl.checkTaskCategoryList: the category list itself is fine, but at least one element inside it is null; such an element cannot be mapped to SQL, so the whole filter is rejected.","triggerScenarios":"Calling taskCategoryIn(...) with a list containing null elements, e.g. from Arrays.asList(\"a\", null) or sparse upstream data.","commonSituations":"Parsing comma-separated strings with trailing commas into lists containing nulls; aggregating category values from heterogeneous sources with missing entries.","solutions":["Filter null (and blank) entries from the collection before calling","Fix the data source/parser that injects nulls","If no valid categories remain, skip the filter entirely"],"exampleFix":"// before\nquery.taskCategoryIn(Arrays.asList(\"hr\", null));\n// after\nList<String> cats = raw.stream().filter(c -> c != null && !c.isBlank()).collect(Collectors.toList());\nif (!cats.isEmpty()) { query.taskCategoryIn(cats); }","handlingStrategy":"validation","validationCode":"List<String> safe = categories.stream().filter(c -> c != null && !c.isBlank()).collect(Collectors.toList());\nif (!safe.isEmpty()) { query.taskCategoryIn(safe); }","typeGuard":"boolean hasNoNullCategories(Collection<String> list) { return list != null && list.stream().allMatch(Objects::nonNull); }","tryCatchPattern":"try {\n    query.taskCategoryIn(categories);\n} catch (FlowableIllegalArgumentException e) {\n    // sanitize and retry once\n    query.taskCategoryIn(categories.stream().filter(Objects::nonNull).collect(Collectors.toList()));\n}","preventionTips":["Sanitize collections (remove null/blank) as they enter the application","Fix parsers that split strings into lists containing nulls","Document that Flowable IN-list setters reject null elements"],"tags":["query","validation","null"],"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"}