{"record":{"id":"d8d708eb3199fa1b","repo":"flowable/flowable-engine","slug":"provided-email-is-null","errorCode":null,"errorMessage":"Provided email is null","messagePattern":"Provided email is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/UserQueryImpl.java","lineNumber":195,"sourceCode":"            throw new FlowableIllegalArgumentException(\"Provided display name is null\");\n        }\n        this.displayNameLike = displayNameLike;\n        return this;\n    }\n\n    @Override\n    public UserQuery userDisplayNameLikeIgnoreCase(String displayNameLikeIgnoreCase) {\n        if (displayNameLikeIgnoreCase == null) {\n            throw new FlowableIllegalArgumentException(\"Provided display name is null\");\n        }\n        this.displayNameLikeIgnoreCase = displayNameLikeIgnoreCase.toLowerCase();\n        return this;\n    }\n\n    @Override\n    public UserQuery userEmail(String email) {\n        if (email == null) {\n            throw new FlowableIllegalArgumentException(\"Provided email is null\");\n        }\n        this.email = email;\n        return this;\n    }\n\n    @Override\n    public UserQuery userEmailLike(String emailLike) {\n        if (emailLike == null) {\n            throw new FlowableIllegalArgumentException(\"Provided emailLike is null\");\n        }\n        this.emailLike = emailLike;\n        return this;\n    }\n\n    @Override\n    public UserQuery memberOfGroup(String groupId) {\n        if (groupId == null) {\n            throw new FlowableIllegalArgumentException(\"Provided groupId is null\");","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/UserQueryImpl.java#L177-L213","documentation":"UserQueryImpl.userEmail(String) throws FlowableIllegalArgumentException when the email filter argument is null. The Flowable idm-engine validates query criteria eagerly so that null filters never reach the database layer as ambiguous predicates. Pass a concrete email string or omit the call entirely.","triggerScenarios":"Calling identityService.createUserQuery().userEmail(null) — the argument is null at the point the query criterion is set.","commonSituations":"Passing a user.email field that was never populated (e.g. an optional profile field from a form or external identity store); mapping a nullable request parameter straight into the query builder.","solutions":["Pass a non-null email string to userEmail(), or skip calling userEmail() when the value is null.","Guard the call: if (email != null) query = query.userEmail(email);","If an approximate match is intended, use userEmailLike() with a non-null pattern instead."],"exampleFix":"// before\nUserQuery q = identityService.createUserQuery().userEmail(user.getEmail());\n// after\nUserQuery q = identityService.createUserQuery();\nif (user.getEmail() != null) {\n    q = q.userEmail(user.getEmail());\n}","handlingStrategy":"validation","validationCode":"if (email != null && !email.isBlank()) { query = query.userEmail(email); }","typeGuard":"boolean hasEmail(String e) { return e != null && !e.isBlank(); }","tryCatchPattern":"try { query.userEmail(email); } catch (FlowableIllegalArgumentException e) { log.warn(\"Null email filter ignored\", e); }","preventionTips":["Null-check optional filter values before applying them to the query","Default null filters to 'no criterion' rather than passing null through","Validate DTO fields at the API boundary before building queries"],"tags":["flowable","idm","null-argument","query"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}