{"record":{"id":"5c6793f98f9b2d0d","repo":"flowable/flowable-engine","slug":"provided-ipaddresslike-is-null","errorCode":null,"errorMessage":"Provided ipAddressLike is null","messagePattern":"Provided ipAddressLike 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":128,"sourceCode":"            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\");\n        }\n        this.ipAddressLike = ipAddressLike;\n        return this;\n    }\n\n    @Override\n    public TokenQuery userAgent(String userAgent) {\n        if (userAgent == null) {\n            throw new FlowableIllegalArgumentException(\"Provided user agent is null\");\n        }\n        this.userAgent = userAgent;\n        return this;\n    }\n\n    @Override\n    public TokenQuery userAgentLike(String userAgentLike) {\n        if (userAgentLike == null) {\n            throw new FlowableIllegalArgumentException(\"Provided userAgentLike is null\");","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/TokenQueryImpl.java#L110-L146","documentation":"Flowable's TokenQueryImpl.ipAddressLike(String ipAddressLike) throws FlowableIllegalArgumentException when the argument is null. The LIKE-style IP pattern must be a non-null string (typically containing % wildcards) to form the SQL clause; validation happens in the fluent method itself.","triggerScenarios":"Calling ipAddressLike(null) on a TokenQuery, e.g. building a pattern like prefix + \"%\" where prefix was null, or passing an optional subnet filter straight from configuration.","commonSituations":"Searching tokens by IP prefix/subnet where the prefix comes from an unset config key or optional request parameter; pattern-building code that assumed a non-null base string.","solutions":["Validate the pattern string before calling ipAddressLike and skip the filter when null","Guard pattern construction: if (prefix != null) query.ipAddressLike(prefix + \"%\");","Provide a configured default pattern or reject requests that omit a required filter"],"exampleFix":"// before\nTokenQuery query = identityService.createTokenQuery().ipAddressLike(prefix + \"%\");\n// after\nTokenQuery query = identityService.createTokenQuery();\nif (prefix != null) {\n    query.ipAddressLike(prefix + \"%\");\n}","handlingStrategy":"validation","validationCode":"if (pattern == null) { throw new IllegalArgumentException(\"pattern must not be null before ipAddressLike()\"); }","typeGuard":"boolean hasPattern(String pattern) { return pattern != null && !pattern.isEmpty(); }","tryCatchPattern":"try { query.ipAddressLike(pattern); } catch (FlowableIllegalArgumentException e) { log.warn(\"Invalid token query: {}\", e.getMessage()); }","preventionTips":["Null-check base strings before concatenating LIKE patterns","Validate config keys that supply IP prefixes at application startup","Build patterns in a helper that returns null (filter omitted) instead of a null-based pattern"],"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-18T11:17:12.947Z"}