{"record":{"id":"539b3256b22c2680","repo":"flowable/flowable-engine","slug":"provided-token-value-is-null","errorCode":null,"errorMessage":"Provided token value is null","messagePattern":"Provided token value 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":83,"sourceCode":"            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\");\n        }\n        this.tokenDate = tokenDate;\n        return this;\n    }\n\n    @Override\n    public TokenQuery tokenDateBefore(Date tokenDateBefore) {\n        if (tokenDateBefore == null) {\n            throw new FlowableIllegalArgumentException(\"Provided tokenDateBefore is null\");","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/TokenQueryImpl.java#L65-L101","documentation":"Flowable's TokenQueryImpl.tokenValue(String tokenValue) throws FlowableIllegalArgumentException when the tokenValue argument is null. Query criteria must be non-null so they can be bound as SQL parameters. The check occurs at query-build time, not at execution time.","triggerScenarios":"Calling tokenValue(null) on a TokenQuery, typically when the token value originated from a nullable source such as a request header, a decoded JWT field, or an unset entity attribute.","commonSituations":"Searching for tokens by value where the value was stripped by a sanitizer; passing a variable that was never assigned; upstream services returning null for missing values that were forwarded unchanged.","solutions":["Validate the token value before querying and handle the missing-value case in application logic","Omit the tokenValue criterion when null if a broader query is acceptable","Ensure values are read from the correct source (header/config) so they are not null by mistake"],"exampleFix":"// before\nTokenQuery query = identityService.createTokenQuery().tokenValue(value);\n// after\nTokenQuery query = identityService.createTokenQuery();\nif (value != null) {\n    query.tokenValue(value);\n}","handlingStrategy":"validation","validationCode":"if (tokenValue == null) { throw new IllegalArgumentException(\"tokenValue must not be null before tokenValue()\"); }","typeGuard":"boolean hasTokenValue(String tokenValue) { return tokenValue != null && !tokenValue.isEmpty(); }","tryCatchPattern":"try { query.tokenValue(value); } catch (FlowableIllegalArgumentException e) { log.warn(\"Invalid token query: {}\", e.getMessage()); }","preventionTips":["Validate headers/request fields before using them as criteria","Avoid forwarding nullable upstream values directly into query builders","Document which filters are optional vs required in your query helper"],"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"}