{"record":{"id":"964ebd04c2268011","repo":"flowable/flowable-engine","slug":"provided-job-id-list-is-null-964ebd","errorCode":null,"errorMessage":"Provided job id list is null","messagePattern":"Provided job id list is null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/ExternalWorkerJobQueryImpl.java","lineNumber":113,"sourceCode":"    }\n\n    @Override\n    public ExternalWorkerJobQuery 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 ExternalWorkerJobQuery 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;\n        }\n        return this;\n    }\n\n    @Override\n    public ExternalWorkerJobQuery processInstanceId(String processInstanceId) {\n        if (processInstanceId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided process instance id is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.processInstanceId = processInstanceId;\n        } else {\n            this.processInstanceId = processInstanceId;","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/ExternalWorkerJobQueryImpl.java#L95-L131","documentation":"ExternalWorkerJobQuery.jobIds(Collection<String>) throws FlowableIllegalArgumentException when the caller passes a null job-id collection. Flowable query builders validate arguments eagerly so that a null filter never silently turns into an unfiltered or broken SQL query. Passing null is always a programming mistake; pass an empty collection or skip the filter instead.","triggerScenarios":"Calling externalWorkerJobQuery().jobIds(null), e.g. when the collection is the result of a map lookup or an optional field that was never initialized.","commonSituations":"Building queries dynamically from user input or config where a list of job ids is optional and null slips through; refactoring code that previously built a list conditionally; deserializing a request payload where 'jobIds' is absent.","solutions":["Pass an actual collection (e.g. Collections.emptyList()) instead of null.","Guard the call site: only invoke jobIds(ids) when ids != null.","If the filter is optional, use the query without the jobIds criterion so results are not over/under-filtered.","Initialize collection fields with a default empty list at construction time."],"exampleFix":"// before\nList<String> ids = params.get(\"jobIds\");\nquery.jobIds(ids); // NPE-free but throws FlowableIllegalArgumentException\n// after\nList<String> ids = params.getOrDefault(\"jobIds\", Collections.emptyList());\nif (!ids.isEmpty()) {\n    query.jobIds(ids);\n}","handlingStrategy":"validation","validationCode":"if (jobIds != null && !jobIds.isEmpty()) {\n    query.jobIds(jobIds);\n}","typeGuard":"boolean hasJobIds(Collection<String> ids) { return ids != null && !ids.isEmpty(); }","tryCatchPattern":"try {\n    query.jobIds(jobIds);\n} catch (FlowableIllegalArgumentException e) {\n    // fall back to unfiltered query or rethrow with context\n}","preventionTips":["Default optional id collections to empty lists, never null.","Wrap query building in a helper that applies filters only for non-null values.","Validate request/config payloads before mapping them into query filters."],"tags":["flowable","query-builder","null-check","java"],"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"}