{"record":{"id":"18eab86c27720e74","repo":"flowable/flowable-engine","slug":"min-priority-is-null-18eab8","errorCode":null,"errorMessage":"Min Priority is null","messagePattern":"Min 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":313,"sourceCode":"    }\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;\n        }\n        return this;\n    }\n\n    @Override\n    public TaskQuery taskMaxPriority(Integer maxPriority) {\n        if (maxPriority == null) {\n            throw new ActivitiIllegalArgumentException(\"Max Priority is null\");\n        }\n        if (orActive) {\n            currentOrQueryObject.maxPriority = maxPriority;\n        } else {\n            this.maxPriority = maxPriority;","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java#L295-L331","documentation":"Thrown by TaskQueryImpl.taskMinPriority(Integer) in the Flowable 5 engine when the minPriority argument is null. Query builder methods in this library validate arguments eagerly so invalid queries fail at construction time rather than producing broken SQL or an empty/incorrect result set at execution time. Passing null means you cannot express a minimum priority filter, so the library refuses immediately with ActivitiIllegalArgumentException.","triggerScenarios":"Calling taskQuery.taskMinPriority(null) directly, or passing a variable that was resolved to null (e.g. a config value or request parameter that defaulted to null) into taskMinPriority.","commonSituations":"Mapping an optional HTTP query parameter straight into taskMinPriority without a default; reading a priority threshold from properties/yaml where the key is absent; deserializing a saved filter DTO where the minPriority field is missing.","solutions":["Pass a concrete Integer value (e.g. taskMinPriority(50)) to taskMinPriority.","If the threshold is optional, call taskMinPriority only when the value is non-null: if (min != null) query.taskMinPriority(min);","Provide a sane default at the config/DTO layer so the value can never be null.","Catch ActivitiIllegalArgumentException at the API boundary and return a 400 with a clear message."],"exampleFix":"// before\nint min = config.getMin(); // may be null\nquery.taskMinPriority(min);\n\n// after\nInteger min = config.getMin();\nif (min != null) {\n    query.taskMinPriority(min);\n}","handlingStrategy":"validation","validationCode":"if (minPriority != null) {\n    query.taskMinPriority(minPriority);\n}","typeGuard":"boolean hasMinPriority(Integer v) { return v != null; }","tryCatchPattern":"try {\n    query.taskMinPriority(minPriority);\n} catch (ActivitiIllegalArgumentException e) {\n    throw new BadRequestException(\"Invalid minPriority: \" + e.getMessage());\n}","preventionTips":["Default unset priority thresholds to concrete values (e.g. 0/100).","Only apply optional filters when their value is non-null.","Validate filter DTOs before building queries."],"tags":["java","flowable","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-14T05:17:10.506Z"}