{"record":{"id":"ce09504195a38178","repo":"flowable/flowable-engine","slug":"priority-is-null","errorCode":null,"errorMessage":"Priority is null","messagePattern":"Priority is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java","lineNumber":391,"sourceCode":"    }\n\n    @Override\n    public TaskQuery taskDescriptionLikeIgnoreCase(String descriptionLikeIgnoreCase) {\n        if (descriptionLikeIgnoreCase == null) {\n            throw new FlowableIllegalArgumentException(\"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 FlowableIllegalArgumentException(\"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 FlowableIllegalArgumentException(\"Min Priority is null\");\n        }\n        if (orActive) {\n            currentOrQueryObject.minPriority = minPriority;\n        } else {\n            this.minPriority = minPriority;","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-task-service/src/main/java/org/flowable/task/service/impl/TaskQueryImpl.java#L373-L409","documentation":"TaskQuery.taskPriority(Integer) rejects null priority with FlowableIllegalArgumentException. Priority is an exact-match integer filter; because Java autoboxing makes it easy to pass a null Integer, the method checks explicitly and fails fast.","triggerScenarios":"Calling taskPriority(null), often from an unboxed/unset Integer field or an optional priority request parameter.","commonSituations":"REST query DTOs where priority was omitted; conversion code mapping UI form values into Integer and leaving null; mixing primitive int and wrapper Integer refactors.","solutions":["Only call taskPriority when the Integer is non-null.","Default to a sentinel/standard priority (e.g. Task.PRIORITY_NORMAL = 50) when unset.","Use primitive int in your own code path and convert deliberately.","Catch FlowableIllegalArgumentException and return a validation error to the caller."],"exampleFix":"// before\nquery.taskPriority(filter.getPriority()); // Integer may be null\n// after\nif (filter.getPriority() != null) {\n    query.taskPriority(filter.getPriority());\n}","handlingStrategy":"validation","validationCode":"if (priority != null) {\n    query.taskPriority(priority);\n}","typeGuard":"boolean hasPriority(Integer p) { return p != null && p >= 0; }","tryCatchPattern":"try {\n    query.taskPriority(priority);\n} catch (FlowableIllegalArgumentException e) {\n    throw new BadRequestException(\"priority filter must not be null\", e);\n}","preventionTips":["Watch for Integer autoboxing: unassigned Integer fields arrive as null.","Use primitive int internally and box only at the call site after a null check.","Apply a default priority (e.g. 50) when the filter is unset.","Null-check both exact and range priority filters in shared builders."],"tags":["flowable","task-query","null-argument","autoboxing"],"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"}