{"record":{"id":"50afa28ae6de2d1b","repo":"flowable/flowable-engine","slug":"priority-is-null-50afa2","errorCode":null,"errorMessage":"Priority is null","messagePattern":"Priority is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java","lineNumber":300,"sourceCode":"    }\n\n    @Override\n    public TaskQuery taskDescriptionLikeIgnoreCase(String descriptionLikeIgnoreCase) {\n        if (descriptionLikeIgnoreCase == null) {\n            throw new ActivitiIllegalArgumentException(\"Task descriptionLikeIgnoreCase is null\");\n        }\n        if (orActive) {\n            currentOrQueryObject.descriptionLikeIgnoreCase = descriptionLikeIgnoreCase.toLowerCase();\n        } else {\n            this.descriptionLikeIgnoreCase = descriptionLikeIgnoreCase.toLowerCase();\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQuery taskPriority(Integer priority) {\n        if (priority == null) {\n            throw new ActivitiIllegalArgumentException(\"Priority is null\");\n        }\n        if (orActive) {\n            currentOrQueryObject.priority = priority;\n        } else {\n            this.priority = priority;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQuery taskMinPriority(Integer minPriority) {\n        if (minPriority == null) {\n            throw new ActivitiIllegalArgumentException(\"Min Priority is null\");\n        }\n        if (orActive) {\n            currentOrQueryObject.minPriority = minPriority;\n        } else {\n            this.minPriority = minPriority;","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java#L282-L318","documentation":"TaskQuery.taskPriority(Integer) requires a non-null priority. Since priority is a boxed Integer, callers can accidentally pass null; the engine throws ActivitiIllegalArgumentException to prevent building a meaningless equality filter.","triggerScenarios":"Calling taskPriority(null), typically from an Integer variable that was never assigned, an unset form field, or Optional.orElse(null).","commonSituations":"Priority filters sourced from UI dropdowns defaulting to null for 'any priority'; JSON payloads missing the priority key; Integer unboxing refactors.","solutions":["Only call taskPriority when the value is non-null; omit the filter for 'any priority'","Use a primitive int default only when a concrete priority is required, guarding the boxed value first","Validate at the API layer that priority filter requests include a numeric value"],"exampleFix":"// before\nquery.taskPriority(request.getPriority()); // may be null\n// after\nInteger priority = request.getPriority();\nif (priority != null) {\n    query.taskPriority(priority);\n}","handlingStrategy":"type-guard","validationCode":"if (priority == null) { /* omit priority filter */ }","typeGuard":"void addPriorityFilter(TaskQuery query, Integer priority) {\n    if (priority != null) {\n        query.taskPriority(priority);\n    }\n}","tryCatchPattern":"try {\n    query.taskPriority(priority);\n} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {\n    // priority was null: build query without it\n}","preventionTips":["Remember boxed Integer criteria can be null; always guard","Give UI dropdowns explicit 'any' handling instead of null defaults","Validate numeric filter fields as required when present in the payload"],"tags":["activiti","task-query","null-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-18T16:30:33.424Z"}