{"record":{"id":"c4bf50a3cbef5f89","repo":"flowable/flowable-engine","slug":"ids-are-null","errorCode":null,"errorMessage":"ids are null","messagePattern":"ids are null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/repository/AppDefinitionQueryImpl.java","lineNumber":140,"sourceCode":"            throw new FlowableIllegalArgumentException(\"nameLike is null\");\n        }\n        this.nameLike = nameLike;\n        return this;\n    }\n\n    @Override\n    public AppDefinitionQueryImpl deploymentId(String deploymentId) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"id is null\");\n        }\n        this.deploymentId = deploymentId;\n        return this;\n    }\n\n    @Override\n    public AppDefinitionQueryImpl deploymentIds(Set<String> deploymentIds) {\n        if (deploymentIds == null) {\n            throw new FlowableIllegalArgumentException(\"ids are null\");\n        } else if (deploymentIds.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"ids is an empty collection\");\n        }\n        this.deploymentIds = deploymentIds;\n        return this;\n    }\n\n    @Override\n    public AppDefinitionQueryImpl appDefinitionKey(String key) {\n        if (key == null) {\n            throw new FlowableIllegalArgumentException(\"key is null\");\n        }\n        this.key = key;\n        return this;\n    }\n\n    @Override\n    public AppDefinitionQueryImpl appDefinitionKeyLike(String keyLike) {","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-app-engine/src/main/java/org/flowable/app/engine/impl/repository/AppDefinitionQueryImpl.java#L122-L158","documentation":"deploymentIds(Set<String>) throws 'ids are null' when the set itself is null. The query needs a non-null collection to build an IN clause over deployment ids. Null is checked before emptiness, so this fires first.","triggerScenarios":"Calling appDefinitionQuery.deploymentIds(null), commonly when the set is built by filtering/collecting code that returned null, or a nullable field of a request object is passed straight through.","commonSituations":"Batch lookups where the id list failed to populate; deserialization left the collection field null; utility method returns null on 'no results' and the result is forwarded directly.","solutions":["Initialize the set to an empty collection upstream, and only call deploymentIds when it is non-null and non-empty","Use Set.of()/new HashSet<>() as a default instead of null in DTOs","Catch FlowableIllegalArgumentException at the boundary and return a client error"],"exampleFix":"// before\nquery.deploymentIds(deploymentIds);\n// after\nif (deploymentIds != null && !deploymentIds.isEmpty()) {\n    query.deploymentIds(deploymentIds);\n}","handlingStrategy":"validation","validationCode":"if (deploymentIds != null && !deploymentIds.isEmpty()) {\n    query.deploymentIds(deploymentIds);\n}","typeGuard":"boolean isNonEmpty(Set<String> s) { return s != null && !s.isEmpty(); }","tryCatchPattern":"try {\n    query.deploymentIds(deploymentIds);\n} catch (FlowableIllegalArgumentException e) {\n    throw new ResponseStatusException(HttpStatus.BAD_REQUEST, e.getMessage(), e);\n}","preventionTips":["Initialize id collections to empty sets, never null, in DTOs and builders","Check both null and empty before passing collections to Flowable queries","Map 'no results' from upstream code to an empty set rather than null"],"tags":["flowable","null-check","collection","query-builder"],"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"}