{"record":{"id":"7eb83649a72e0182","repo":"flowable/flowable-engine","slug":"groupids-are-null","errorCode":null,"errorMessage":"groupIds are null","messagePattern":"groupIds are null","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java","lineNumber":1127,"sourceCode":"    public HistoricCaseInstanceQuery involvedGroup(String groupId, String identityLinkType) {\n        if (groupId == null) {\n            throw new FlowableIllegalArgumentException(\"groupId is null\");\n        }\n        if (identityLinkType == null) {\n            throw new FlowableIllegalArgumentException(\"identityLinkType is null\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.involvedGroupIdentityLink = new IdentityLinkQueryObject(null, groupId, identityLinkType);\n        } else {\n            this.involvedGroupIdentityLink = new IdentityLinkQueryObject(null, groupId, identityLinkType);\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricCaseInstanceQuery involvedGroups(Set<String> groupIds) {\n        if (groupIds == null) {\n            throw new FlowableIllegalArgumentException(\"groupIds are null\");\n        }\n        if (groupIds.isEmpty()) {\n            throw new FlowableIllegalArgumentException(\"groupIds are empty\");\n        }\n        if (inOrStatement) {\n            this.currentOrQueryObject.involvedGroups = groupIds;\n        } else {\n            this.involvedGroups = groupIds;\n        }\n        return this;\n    }\n\n    @Override\n    public HistoricCaseInstanceQuery or() {\n        if (inOrStatement) {\n            throw new FlowableException(\"the query is already in an or statement\");\n        }\n","sourceCodeStart":1109,"sourceCodeEnd":1145,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/HistoricCaseInstanceQueryImpl.java#L1109-L1145","documentation":"HistoricCaseInstanceQueryImpl.involvedGroups(Set<String>) throws FlowableIllegalArgumentException(\"groupIds are null\") when the set of group ids is null. The set feeds an IN-clause over group identity links, so null input is rejected immediately.","triggerScenarios":"Calling involvedGroups(null) on a HistoricCaseInstanceQuery, inside or outside an or() block, before executing the query.","commonSituations":"Group memberships lookup returned null (e.g. user with no groups); a roles/claims mapper produced null instead of an empty set; generic query-builder code passing an unset parameter.","solutions":["Pass a non-null Set of group ids; initialize empty collections rather than null.","Only add the involvedGroups filter when the set exists; branch on membership results.","Make membership-resolution helpers return an empty set and check isEmpty before filtering.","Ensure config/claims-to-set conversion cannot return null."],"exampleFix":"// before\nquery.involvedGroups(groupIds); // groupIds may be null\n// after\nif (groupIds != null && !groupIds.isEmpty()) {\n    query.involvedGroups(groupIds);\n}","handlingStrategy":"validation","validationCode":"if (groupIds == null || groupIds.isEmpty()) {\n    throw new IllegalArgumentException(\"groupIds must be non-empty\");\n}\nquery.involvedGroups(groupIds);","typeGuard":"boolean isNonEmpty(Set<String> s) {\n    return s != null && !s.isEmpty();\n}","tryCatchPattern":"try {\n    query.involvedGroups(groupIds);\n} catch (FlowableIllegalArgumentException e) {\n    if (\"groupIds are null\".equals(e.getMessage())) {\n        // skip filter or rethrow with context\n    } else {\n        throw e;\n    }\n}","preventionTips":["Initialize group-id sets as empty collections rather than null","Branch on membership lookup results before adding group filters","Ensure claims/roles-to-set mappers never return null","Validate query inputs once in a shared query-builder helper"],"tags":["java","flowable","cmmn","query","null-argument","identity-link"],"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"}