{"record":{"id":"c9191c1409d5a2a5","repo":"flowable/flowable-engine","slug":"form-tenantid-is-null","errorCode":null,"errorMessage":"form tenantId is null","messagePattern":"form tenantId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/ChannelDefinitionQueryImpl.java","lineNumber":312,"sourceCode":"            throw new FlowableIllegalArgumentException(\"resourceName is null\");\n        }\n        this.resourceName = resourceName;\n        return this;\n    }\n\n    @Override\n    public ChannelDefinitionQueryImpl channelDefinitionResourceNameLike(String resourceNameLike) {\n        if (resourceNameLike == null) {\n            throw new FlowableIllegalArgumentException(\"resourceNameLike is null\");\n        }\n        this.resourceNameLike = resourceNameLike;\n        return this;\n    }\n\n    @Override\n    public ChannelDefinitionQueryImpl tenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new FlowableIllegalArgumentException(\"form tenantId is null\");\n        }\n        this.tenantId = tenantId;\n        return this;\n    }\n\n    @Override\n    public ChannelDefinitionQueryImpl tenantIdLike(String tenantIdLike) {\n        if (tenantIdLike == null) {\n            throw new FlowableIllegalArgumentException(\"form tenantId is null\");\n        }\n        this.tenantIdLike = tenantIdLike;\n        return this;\n    }\n\n    @Override\n    public ChannelDefinitionQueryImpl withoutTenantId() {\n        this.withoutTenantId = true;\n        return this;","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/ChannelDefinitionQueryImpl.java#L294-L330","documentation":"ChannelDefinitionQueryImpl.tenantId() throws FlowableIllegalArgumentException with message 'form tenantId is null' when the tenantId argument is null. (The 'form' prefix is a copy-paste artifact from FormDefinitionQueryImpl; the check applies to channel definitions.) A null tenant id is rejected up front because it would produce an invalid equality filter.","triggerScenarios":"Calling tenantId(null) on a ChannelDefinitionQuery, commonly when the tenant id is resolved from an unauthenticated context or a missing tenant header/property.","commonSituations":"Multi-tenant apps where the current tenant is optional and code passes null unconditionally; TenantContext or request attribute not populated.","solutions":["Pass a valid non-null tenant id string","Guard: call tenantId() only when the resolved tenant is non-null","Use tenantIdLike(\"%\") or omit the filter to query across all tenants"],"exampleFix":"// before\nquery.tenantId(tenantId);\n// after\nif (tenantId != null) { query.tenantId(tenantId); }","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(tenantId, \"tenantId must not be null\");","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Resolve tenant context once in a shared utility"],"tags":["null","tenant","query","multi-tenancy"],"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"}