{"record":{"id":"7b5ac15a3699d193","repo":"flowable/flowable-engine","slug":"process-category-list-is-null-7b5ac1","errorCode":null,"errorMessage":"Process category list is null","messagePattern":"Process category list is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java","lineNumber":1032,"sourceCode":"            this.processDefinitionName = processDefinitionName;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQuery processDefinitionNameLike(String processDefinitionNameLike) {\n        if (orActive) {\n            currentOrQueryObject.processDefinitionNameLike = processDefinitionNameLike;\n        } else {\n            this.processDefinitionNameLike = processDefinitionNameLike;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQuery processCategoryIn(List<String> processCategoryInList) {\n        if (processCategoryInList == null) {\n            throw new ActivitiIllegalArgumentException(\"Process category list is null\");\n        }\n        if (processCategoryInList.isEmpty()) {\n            throw new ActivitiIllegalArgumentException(\"Process category list is empty\");\n        }\n        for (String processCategory : processCategoryInList) {\n            if (processCategory == null) {\n                throw new ActivitiIllegalArgumentException(\"None of the given process categories can be null\");\n            }\n        }\n\n        if (orActive) {\n            currentOrQueryObject.processCategoryInList = processCategoryInList;\n        } else {\n            this.processCategoryInList = processCategoryInList;\n        }\n        return this;\n    }\n","sourceCodeStart":1014,"sourceCodeEnd":1050,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java#L1014-L1050","documentation":"TaskQueryImpl.processCategoryIn(List<String>) throws ActivitiIllegalArgumentException when the processCategoryInList is null. Categories filter tasks by the category of their underlying process definition, and a null list cannot form the required IN clause, so it is rejected at query-build time.","triggerScenarios":"Calling taskQuery.processCategoryIn(null), typically when the category list comes from an unset config property, null request parameter, or failed lookup.","commonSituations":"Category-based task dashboards whose filter options are configured per environment; a missing or misnamed config key yields null and is passed straight into the query.","solutions":["Default the category list to Collections.emptyList() at the source so it is never null.","Only call processCategoryIn when the list is non-null and non-empty.","Catch ActivitiIllegalArgumentException around query construction to surface a clear validation error."],"exampleFix":"// before\nList<String> categories = config.getCategories(); // may be null\ntaskQuery.processCategoryIn(categories);\n\n// after\nList<String> categories = config.getCategories();\nif (categories != null && !categories.isEmpty()) {\n    taskQuery.processCategoryIn(categories);\n}","handlingStrategy":"validation","validationCode":"if (processCategoryInList == null || processCategoryInList.isEmpty()) {\n    // skip category filter\n} else {\n    taskQuery.processCategoryIn(processCategoryInList);\n}","typeGuard":"boolean hasCategories(List<String> categories) { return categories != null && !categories.isEmpty(); }","tryCatchPattern":"try {\n    return taskQuery.processCategoryIn(categories).list();\n} catch (ActivitiIllegalArgumentException e) {\n    log.warn(\"Invalid category filter: {}\", e.getMessage());\n    throw new BadRequestException(e.getMessage());\n}","preventionTips":["Provide defaults for config-driven category lists","Validate config keys at startup so missing values fail early","Treat unset filters as 'skip the method call'"],"tags":["activiti","flowable","task-query","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"}