{"record":{"id":"1b358be78953302f","repo":"flowable/flowable-engine","slug":"provided-job-id-is-null","errorCode":null,"errorMessage":"Provided job id is null","messagePattern":"Provided job id is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/DeadLetterJobQueryImpl.java","lineNumber":99,"sourceCode":"    protected boolean inOrStatement;\n\n    public DeadLetterJobQueryImpl() {\n    }\n\n    public DeadLetterJobQueryImpl(CommandContext commandContext, JobServiceConfiguration jobServiceConfiguration) {\n        super(commandContext);\n        this.jobServiceConfiguration = jobServiceConfiguration;\n    }\n\n    public DeadLetterJobQueryImpl(CommandExecutor commandExecutor, JobServiceConfiguration jobServiceConfiguration) {\n        super(commandExecutor);\n        this.jobServiceConfiguration = jobServiceConfiguration;\n    }\n\n    @Override\n    public DeadLetterJobQueryImpl jobId(String jobId) {\n        if (jobId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided job id is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.id = jobId;\n        } else {\n            this.id = jobId;\n        }\n        return this;\n    }\n\n    @Override\n    public DeadLetterJobQuery jobIds(Collection<String> jobIds) {\n        if (jobIds == null) {\n            throw new FlowableIllegalArgumentException(\"Provided job id list is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.jobIds = jobIds;\n        } else {\n            this.jobIds = jobIds;","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/DeadLetterJobQueryImpl.java#L81-L117","documentation":"DeadLetterJobQueryImpl.jobId(String) validates its argument before storing it as a query filter. A null jobId would produce an ill-formed query, so it throws FlowableIllegalArgumentException(\"Provided job id is null\") immediately.","triggerScenarios":"Calling deadLetterJobQuery().jobId(null) — typically when the job id variable passed in is uninitialized or the result of a lookup that returned null.","commonSituations":"Passing a job id read from a configuration/properties file that was not set; chaining after a previous API call that returned null; building dynamic queries where the id clause is optional but is added unconditionally.","solutions":["Check the id for null before calling jobId()","Only add the jobId filter when the value is non-null (build the query conditionally)","Fix upstream code that yields a null job id (failed lookups, unset variables)","Use jobIds(...) semantics or omit the filter entirely if querying without an id is intended"],"exampleFix":"// before\nquery.jobId(maybeNullId);\n// after\nif (maybeNullId != null) {\n    query.jobId(maybeNullId);\n}","handlingStrategy":"validation","validationCode":"if (jobId != null) {\n    query.jobId(jobId);\n}","typeGuard":"boolean hasJobId(String id) { return id != null && !id.isEmpty(); }","tryCatchPattern":"try {\n    query.jobId(jobId);\n} catch (FlowableIllegalArgumentException e) {\n    // null id supplied; drop the filter or supply a default\n}","preventionTips":["Null-check ids before applying query filters","Build queries conditionally rather than unconditionally","Ensure upstream lookups cannot silently produce null ids","Prefer an empty-result query strategy over null filters"],"tags":["query","null-check","flowable","job-service"],"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"}