{"record":{"id":"2f6b510cc97af863","repo":"flowable/flowable-engine","slug":"tenant-ids-is-null","errorCode":null,"errorMessage":"tenant ids is null","messagePattern":"tenant ids is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-eventsubscription-service/src/main/java/org/flowable/eventsubscription/service/impl/EventSubscriptionQueryImpl.java","lineNumber":409,"sourceCode":"    @Override\n    public EventSubscriptionQueryImpl tenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new FlowableIllegalArgumentException(\"tenant id is null\");\n        }\n\n        if (inOrStatement) {\n            this.currentOrQueryObject.tenantId = tenantId;\n        } else {\n            this.tenantId = tenantId;\n        }\n\n        return this;\n    }\n\n    @Override\n    public EventSubscriptionQuery tenantIds(Collection<String> tenantIds) {\n        if (tenantIds == null) {\n            throw new FlowableIllegalArgumentException(\"tenant ids is null\");\n        }\n\n        if (inOrStatement) {\n            this.currentOrQueryObject.tenantIds = tenantIds;\n        } else {\n            this.tenantIds = tenantIds;\n        }\n\n        return this;\n    }\n\n    @Override\n    public EventSubscriptionQuery withoutTenantId() {\n        if (inOrStatement) {\n            this.currentOrQueryObject.withoutTenantId = true;\n        } else {\n            this.withoutTenantId = true;\n        }","sourceCodeStart":391,"sourceCodeEnd":427,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-eventsubscription-service/src/main/java/org/flowable/eventsubscription/service/impl/EventSubscriptionQueryImpl.java#L391-L427","documentation":"EventSubscriptionQuery.tenantIds() requires a non-null Collection of tenant ids. Flowable throws FlowableIllegalArgumentException when the collection is null; an empty collection is accepted but null is not, since null cannot form an IN predicate. The framework distinguishes 'no filter' (don't call) from 'null filter' (error).","triggerScenarios":"Calling eventSubscriptionQuery.tenantIds(null), e.g. when the tenant list comes from a nullable configuration property, an empty optional, or a split on a null string.","commonSituations":"Multi-tenant dashboards where the allowed-tenant list is loaded from config/DB and may be absent; deserializing a request body where tenantIds was omitted and mapped to null.","solutions":["Pass an empty collection instead of null when no tenants are applicable, or skip the call","Default the collection with Collections.emptyList() at the source","Fix the deserialization/config loading so tenantIds defaults to an empty list, never null"],"exampleFix":"// before\nquery.tenantIds(config.getTenantIds());\n\n// after\nquery.tenantIds(config.getTenantIds() != null ? config.getTenantIds() : Collections.emptyList());","handlingStrategy":"validation","validationCode":"if (tenantIds == null) {\n    tenantIds = Collections.emptyList();\n}","typeGuard":"boolean validTenantIds(Collection<String> c) { return c != null && c.stream().allMatch(Objects::nonNull); }","tryCatchPattern":"try {\n    query.tenantIds(tenantIds);\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"tenantIds null\", e);\n}","preventionTips":["Initialize collection fields to empty collections at declaration/deserialization","Never pass null collections to IN-style query setters","Normalize config-loaded lists with Optional.orElse(Collections.emptyList())"],"tags":["flowable","query","tenant","null-check","collection"],"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"}