{"record":{"id":"91ca4a60f663dd40","repo":"flowable/flowable-engine","slug":"provided-handlertype-is-null-91ca4a","errorCode":null,"errorMessage":"Provided handlerType is null","messagePattern":"Provided handlerType is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/JobQueryImpl.java","lineNumber":386,"sourceCode":"    }\n\n    @Override\n    public JobQueryImpl executionId(String executionId) {\n        if (executionId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided execution id is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.executionId = executionId;\n        } else {\n            this.executionId = executionId;\n        }\n        return this;\n    }\n\n    @Override\n    public JobQueryImpl handlerType(String handlerType) {\n        if (handlerType == null) {\n            throw new FlowableIllegalArgumentException(\"Provided handlerType is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.handlerType = handlerType;\n        } else {\n            this.handlerType = handlerType;\n        }\n        return this;\n    }\n\n    @Override\n    public JobQuery handlerTypes(Collection<String> handlerTypes) {\n        if (handlerTypes == null) {\n            throw new FlowableIllegalArgumentException(\"Provided handlerTypes are null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.handlerTypes = handlerTypes;\n        } else {\n            this.handlerTypes = handlerTypes;","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/JobQueryImpl.java#L368-L404","documentation":"FlowableIllegalArgumentException thrown by JobQueryImpl.handlerType(String) when the handlerType argument is null. Flowable validates all query filter arguments up front so that an invalid query fails immediately at construction time rather than producing a broken SQL query or empty result set at execution. A null handlerType is never a meaningful filter value.","triggerScenarios":"Calling jobQuery.handlerType(null) directly, or passing a variable/constant that resolves to null (e.g. a config-driven handler type that was never set) into handlerType().","commonSituations":"Building dynamic queries where the job handler type comes from configuration, a database column, or a REST request parameter that is optional upstream but mandatory here; refactoring that renamed handler types leaving a null default.","solutions":["Pass a concrete handler type string (e.g. \"message\" or \"timer\") to handlerType().","Guard the call: only invoke handlerType() when the value is non-null, otherwise skip adding this filter.","Check the source of the value (config/property/request param) and provide a sensible default before building the query."],"exampleFix":"// before\nString type = properties.get(\"jobHandlerType\");\nquery.handlerType(type);\n\n// after\nString type = properties.get(\"jobHandlerType\");\nif (type != null) {\n    query.handlerType(type);\n}","handlingStrategy":"validation","validationCode":"if (handlerType == null || handlerType.isEmpty()) {\n    throw new IllegalArgumentException(\"handlerType must be a non-empty string before calling handlerType()\");\n}\nquery.handlerType(handlerType);","typeGuard":"boolean hasHandlerType = handlerType instanceof String && !((String) handlerType).isEmpty();","tryCatchPattern":"try {\n    query.handlerType(handlerType);\n} catch (org.flowable.common.engine.api.FlowableIllegalArgumentException e) {\n    log.warn(\"Invalid handlerType filter: {}\", e.getMessage());\n}","preventionTips":["Validate filter inputs from config/REST layers before building queries.","Only add a filter method call when the value is non-null.","Centralize query building in one helper that performs null-skipping."],"tags":["null-argument","query","validation","flowable"],"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"}