{"record":{"id":"5504af4e92479b82","repo":"flowable/flowable-engine","slug":"task-category-list-is-null","errorCode":null,"errorMessage":"Task category list is null","messagePattern":"Task category 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":1841,"sourceCode":"            this.categoryInList = taskCategoryInList;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricTaskInstanceQuery taskCategoryNotIn(Collection<String> taskCategoryNotInList) {\n        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        }","sourceCodeStart":1823,"sourceCodeEnd":1859,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/HistoricTaskInstanceQueryImpl.java#L1823-L1859","documentation":"The internal helper checkTaskCategoryList throws this when taskCategoryIn(...) / taskCategoryNotIn(...) is called with a null collection. The category filter requires an actual, non-empty list of category strings.","triggerScenarios":"Calling taskCategoryIn(null) or taskCategoryNotIn(null), e.g. when a nullable variable or optional request parameter is passed straight through.","commonSituations":"REST endpoints mapping an absent query parameter to null; building filters from a map lookup that returns null for an unknown key.","solutions":["Null-check the collection before calling taskCategoryIn/taskCategoryNotIn","Initialize the collection to an empty list and skip the filter when empty","Fix the upstream source that produces a null list"],"exampleFix":"// before\nquery.taskCategoryIn(categories); // may be null\n// after\nif (categories != null && !categories.isEmpty()) { query.taskCategoryIn(categories); }","handlingStrategy":"validation","validationCode":"if (categories != null && !categories.isEmpty()) { query.taskCategoryIn(categories); }","typeGuard":"boolean isValidCategoryList(Collection<String> list) {\n    return list != null && !list.isEmpty() && list.stream().allMatch(Objects::nonNull);\n}","tryCatchPattern":"try {\n    query.taskCategoryIn(categories);\n} catch (FlowableIllegalArgumentException e) {\n    // apply default or no category filter\n}","preventionTips":["Never forward nullable collections into taskCategoryIn/taskCategoryNotIn","Default empty/null category inputs to 'no filter' semantics","Validate request DTOs before constructing queries"],"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"}