{"record":{"id":"fc337b929d5bcc5c","repo":"flowable/flowable-engine","slug":"provided-tokendateafter-is-null","errorCode":null,"errorMessage":"Provided tokenDateAfter is null","messagePattern":"Provided tokenDateAfter 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":110,"sourceCode":"            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\");\n        }\n        this.tokenDateBefore = tokenDateBefore;\n        return this;\n    }\n\n    @Override\n    public TokenQuery tokenDateAfter(Date tokenDateAfter) {\n        if (tokenDateAfter == null) {\n            throw new FlowableIllegalArgumentException(\"Provided tokenDateAfter is null\");\n        }\n        this.tokenDateAfter = tokenDateAfter;\n        return this;\n    }\n\n    @Override\n    public TokenQuery ipAddress(String ipAddress) {\n        if (ipAddress == null) {\n            throw new FlowableIllegalArgumentException(\"Provided ip address is null\");\n        }\n        this.ipAddress = ipAddress;\n        return this;\n    }\n\n    @Override\n    public TokenQuery ipAddressLike(String ipAddressLike) {\n        if (ipAddressLike == null) {\n            throw new FlowableIllegalArgumentException(\"Provided ipAddressLike is null\");","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/TokenQueryImpl.java#L92-L128","documentation":"Flowable's TokenQueryImpl.tokenDateAfter(Date tokenDateAfter) throws FlowableIllegalArgumentException when the argument is null. This lower-bound date criterion must be non-null for SQL binding and is validated in the fluent method before execution.","triggerScenarios":"Calling tokenDateAfter(null) on a TokenQuery, e.g. when an 'since' filter came from an optional request parameter or a failed date parse returned null.","commonSituations":"Queries for tokens created after a given time in dashboards/reports where the from-date is optional; migration scripts with configurable start dates; deserialization leaving Date fields null.","solutions":["Check the date before applying the criterion and skip it when null","Resolve a default from-date (e.g. epoch or now minus a window) rather than passing null","Return a 400-style validation error from your API when the from-date is required but missing"],"exampleFix":"// before\nTokenQuery query = identityService.createTokenQuery().tokenDateAfter(since);\n// after\nTokenQuery query = identityService.createTokenQuery();\nif (since != null) {\n    query.tokenDateAfter(since);\n}","handlingStrategy":"validation","validationCode":"if (since == null) { throw new IllegalArgumentException(\"since must not be null before tokenDateAfter()\"); }","typeGuard":"boolean hasSince(Date since) { return since != null; }","tryCatchPattern":"try { query.tokenDateAfter(since); } catch (FlowableIllegalArgumentException e) { log.warn(\"Invalid token query: {}\", e.getMessage()); }","preventionTips":["Check date inputs from optional request parameters before filtering","Default from-dates to a sensible window instead of null","Validate parsed dates immediately after parsing"],"tags":["flowable","idm","query","token","date","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"}