{"record":{"id":"7c97e29b1530d39f","repo":"flowable/flowable-engine","slug":"provided-ids-is-null-7c97e2","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/UserQueryImpl.java","lineNumber":78,"sourceCode":"    }\n\n    public UserQueryImpl(CommandExecutor commandExecutor) {\n        super(commandExecutor);\n    }\n\n    @Override\n    public UserQuery userId(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 UserQuery userIds(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 UserQuery userIdIgnoreCase(String id) {\n        if (id == null) {\n            throw new FlowableIllegalArgumentException(\"Provided id is null\");\n        }\n        this.idIgnoreCase = id.toLowerCase();\n        return this;\n    }\n\n    @Override\n    public UserQuery userFirstName(String firstName) {\n        if (firstName == null) {\n            throw new FlowableIllegalArgumentException(\"Provided first name is null\");","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/UserQueryImpl.java#L60-L96","documentation":"UserQueryImpl.userIds(List<String>) filters users whose id is in the given list. Passing a null list throws FlowableIllegalArgumentException because an IN criterion requires an explicit collection; null cannot be distinguished from 'no filter'. The check runs at query-build time.","triggerScenarios":"Calling UserQuery.userIds(null), usually with a collection built upstream that came back null (e.g. Optional misuse, a service method returning null instead of an empty list).","commonSituations":"Bulk lookups where the id list was derived from another query that returned null; configuration-driven filters not configured; Java code paths where a null collection slipped past a null-tolerant helper.","solutions":["Pass a non-null List (use Collections.emptyList() if no ids were collected, though that matches nothing).","Only call userIds(...) when the list is non-null; otherwise skip the criterion.","Fix upstream producers to return empty collections rather than null."],"exampleFix":"// before\nList<String> ids = userLookup.findIdsByEmail(email); // may return null\nUserQuery q = identityService.createUserQuery().userIds(ids);\n\n// after\nList<String> ids = userLookup.findIdsByEmail(email);\nUserQuery q = identityService.createUserQuery();\nif (ids != null && !ids.isEmpty()) {\n    q = q.userIds(ids);\n}","handlingStrategy":"validation","validationCode":"if (ids == null) { ids = Collections.emptyList(); }\nUserQuery q = identityService.createUserQuery();\nif (!ids.isEmpty()) { q = q.userIds(ids); }","typeGuard":"boolean hasIds(List<String> ids) { return ids != null && !ids.isEmpty(); }","tryCatchPattern":"try {\n    query.userIds(ids);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().contains(\"ids is null\")) { /* skip criterion */ } else { throw e; }\n}","preventionTips":["Make collection producers return empty lists instead of null.","Skip the IN criterion when the list is null or empty.","Avoid overloading one query builder with both null and empty semantics."],"tags":["null-check","query-builder","idm-engine","java"],"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"}