{"record":{"id":"b510f87d299ea6cf","repo":"flowable/flowable-engine","slug":"provided-id-list-is-null","errorCode":null,"errorMessage":"Provided id list is null","messagePattern":"Provided id list is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/GroupQueryImpl.java","lineNumber":67,"sourceCode":"    }\n\n    public GroupQueryImpl(CommandExecutor commandExecutor) {\n        super(commandExecutor);\n    }\n\n    @Override\n    public GroupQuery groupId(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 GroupQuery groupIds(List<String> ids) {\n        if (ids == null) {\n            throw new FlowableIllegalArgumentException(\"Provided id list is null\");\n        }\n        this.ids = ids;\n        return this;\n    }\n\n    @Override\n    public GroupQuery groupName(String name) {\n        if (name == null) {\n            throw new FlowableIllegalArgumentException(\"Provided name is null\");\n        }\n        this.name = name;\n        return this;\n    }\n\n    @Override\n    public GroupQuery groupNameLike(String nameLike) {\n        if (nameLike == null) {\n            throw new FlowableIllegalArgumentException(\"Provided name is null\");","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/GroupQueryImpl.java#L49-L85","documentation":"Fluent-setter validation in GroupQueryImpl.groupIds: a null id List was passed as the group-id collection filter; the builder rejects it so 'no filter' and 'null filter' stay distinguishable.","triggerScenarios":"Calling .groupIds(null) — e.g. the list comes from an unpopulated collection, an Optional chain, or a method returning null instead of an empty list.","commonSituations":"Batch lookups where the caller's collection was never initialized, deserialized JSON bodies with a missing array field mapped to null, helper methods returning null on 'no ids'.","solutions":["Pass an empty list (or skip the groupIds() call) when there are no ids to filter on.","Normalize null collections to Collections.emptyList() before building the query.","Ensure upstream deserialization defaults missing arrays to empty lists.","Use Objects.requireNonNullElse(ids, List.of()) style normalization at the boundary."],"exampleFix":"// before\nList<String> ids = payload.getGroupIds(); // null when field absent\nGroup g = identityService.createGroupQuery().groupIds(ids).singleResult();\n// after\nList<String> ids = payload.getGroupIds();\nif (ids != null && !ids.isEmpty()) {\n    query = query.groupIds(ids);\n}\nGroup g = query.singleResult();","handlingStrategy":"validation","validationCode":"List<String> ids = payload.getGroupIds() == null ? Collections.emptyList() : payload.getGroupIds();\nGroupQuery q = identityService.createGroupQuery();\nif (!ids.isEmpty()) q = q.groupIds(ids);","typeGuard":"static List<String> orEmpty(List<String> list) { return list == null ? Collections.emptyList() : list; }","tryCatchPattern":"try {\n    q = q.groupIds(ids);\n} catch (FlowableIllegalArgumentException e) {\n    throw new BadRequestException(\"groupIds must not be null\", e);\n}","preventionTips":["Default deserialized collection fields to empty lists (e.g. new ArrayList<>() initializers).","Skip criteria whose collections are null or empty rather than passing them.","Normalize null collections at API boundaries with Objects.requireNonNullElse.","Never let helper methods return null collections."],"tags":["query","null-argument","collections"],"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"}