{"record":{"id":"0ba2e3d693d7780e","repo":"flowable/flowable-engine","slug":"key-is-null-0ba2e3","errorCode":null,"errorMessage":"key is null","messagePattern":"key is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/DeploymentQueryImpl.java","lineNumber":126,"sourceCode":"    @Override\n    public DeploymentQueryImpl deploymentTenantIdLike(String tenantIdLike) {\n        if (tenantIdLike == null) {\n            throw new ActivitiIllegalArgumentException(\"deploymentTenantIdLike is null\");\n        }\n        this.tenantIdLike = tenantIdLike;\n        return this;\n    }\n\n    @Override\n    public DeploymentQueryImpl deploymentWithoutTenantId() {\n        this.withoutTenantId = true;\n        return this;\n    }\n\n    @Override\n    public DeploymentQueryImpl processDefinitionKey(String key) {\n        if (key == null) {\n            throw new ActivitiIllegalArgumentException(\"key is null\");\n        }\n        this.processDefinitionKey = key;\n        return this;\n    }\n\n    @Override\n    public DeploymentQueryImpl processDefinitionKeyLike(String keyLike) {\n        if (keyLike == null) {\n            throw new ActivitiIllegalArgumentException(\"keyLike is null\");\n        }\n        this.processDefinitionKeyLike = keyLike;\n        return this;\n    }\n\n    // sorting ////////////////////////////////////////////////////////\n\n    @Override\n    public DeploymentQuery orderByDeploymentId() {","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/DeploymentQueryImpl.java#L108-L144","documentation":"DeploymentQueryImpl.processDefinitionKey() throws ActivitiIllegalArgumentException when the key argument is null. Even though this is a DeploymentQuery, it can filter by process definition key, and that key must be a concrete non-null value to build the predicate.","triggerScenarios":"Calling repositoryService.createDeploymentQuery().processDefinitionKey(null), typically when the definition key was resolved from a nullable variable, request parameter, or a failed lookup on a process definition entity.","commonSituations":"Pages that query deployments for an optional selected process definition; keys read from process variables or forms that were never set; refactor replacing a hardcoded key with a parameter defaulting to null.","solutions":["Pass a non-null process definition key","Guard the call: only add the filter when the key is present","Validate the key at the API boundary before invoking the query","Fix the upstream lookup that should have produced the key"],"exampleFix":"// before\nDeploymentQuery q = repositoryService.createDeploymentQuery().processDefinitionKey(defKey);\n// after\nDeploymentQuery q = repositoryService.createDeploymentQuery();\nif (defKey != null) {\n    q = q.processDefinitionKey(defKey);\n}","handlingStrategy":"validation","validationCode":"if (processDefinitionKey == null) { throw new IllegalArgumentException(\"processDefinitionKey must not be null\"); }\nrepositoryService.createDeploymentQuery().processDefinitionKey(processDefinitionKey)...","typeGuard":"boolean hasText(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try {\n    repositoryService.createDeploymentQuery().processDefinitionKey(key).list();\n} catch (ActivitiIllegalArgumentException e) {\n    log.error(\"process definition key was null\", e);\n}","preventionTips":["Validate the key at the API boundary","Only apply optional key filters when present","Verify upstream lookups actually return the key before use"],"tags":["java","activiti","null-argument","query"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}