{"record":{"id":"e47ef224623a28d7","repo":"flowable/flowable-engine","slug":"provided-ids-is-null","errorCode":null,"errorMessage":"Provided ids is null","messagePattern":"Provided ids is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/TokenQueryImpl.java","lineNumber":74,"sourceCode":"    }\n\n    public TokenQueryImpl(CommandExecutor commandExecutor) {\n        super(commandExecutor);\n    }\n\n    @Override\n    public TokenQuery tokenId(String id) {\n        if (id == null) {\n            throw new FlowableIllegalArgumentException(\"Provided id is null\");\n        }\n        this.id = id;\n        return this;\n    }\n\n    @Override\n    public TokenQuery tokenIds(List<String> ids) {\n        if (ids == null) {\n            throw new FlowableIllegalArgumentException(\"Provided ids is null\");\n        }\n        this.ids = ids;\n        return this;\n    }\n\n    @Override\n    public TokenQuery tokenValue(String tokenValue) {\n        if (tokenValue == null) {\n            throw new FlowableIllegalArgumentException(\"Provided token value is null\");\n        }\n        this.tokenValue = tokenValue;\n        return this;\n    }\n\n    @Override\n    public TokenQuery tokenDate(Date tokenDate) {\n        if (tokenDate == null) {\n            throw new FlowableIllegalArgumentException(\"Provided token date is null\");","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/TokenQueryImpl.java#L56-L92","documentation":"Flowable's TokenQueryImpl.tokenIds(List<String> ids) throws FlowableIllegalArgumentException when the ids list is null. The null list cannot be converted into a SQL IN clause for the token query. Validation happens immediately in the fluent API method, before command execution.","triggerScenarios":"Calling tokenIds(null) on a TokenQuery, e.g. when an optional id collection from a request or upstream service was null and the call was made unconditionally.","commonSituations":"Batch lookups of tokens where the input collection came back null from a cache or API; deserialized JSON payloads with absent arrays; dynamic query construction where a branch forgot to set the list.","solutions":["Only call tokenIds when the list is non-null, or pass an empty list if you want the criterion to be a no-op equivalent (or omit it entirely)","Normalize upstream nulls: List<String> safeIds = ids == null ? Collections.emptyList() : ids;","Fail fast in your own service layer with a clearer domain message when ids are required"],"exampleFix":"// before\nTokenQuery query = identityService.createTokenQuery().tokenIds(ids);\n// after\nTokenQuery query = identityService.createTokenQuery();\nif (ids != null && !ids.isEmpty()) {\n    query.tokenIds(ids);\n}","handlingStrategy":"validation","validationCode":"if (ids == null) { throw new IllegalArgumentException(\"ids must not be null before tokenIds()\"); }","typeGuard":"boolean isValidIds(List<String> ids) { return ids != null; }","tryCatchPattern":"try { query.tokenIds(ids); } catch (FlowableIllegalArgumentException e) { log.warn(\"Invalid token query: {}\", e.getMessage()); }","preventionTips":["Default collection inputs to Collections.emptyList()","Check list presence before building batch queries","Keep query-building code close to validation so nulls are caught early"],"tags":["flowable","idm","query","token","null-check"],"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"}