provide better error handling logic for when a tenant doesn't exist
@@ -1694,10 +1694,14 @@ private FunctionDetails validateUpdateRequestParams(final String tenant,
}
if (clientRole != null) {
+ try {
TenantInfo tenantInfo = worker().getBrokerAdmin().tenants().getTenantInfo(tenant);
- if (tenantInfo.getAdminRoles() != null && tenantInfo.getAdminRoles().contains(clientRole)) {
+ if (tenantInfo != null && tenantInfo.getAdminRoles() != null && tenantInfo.getAdminRoles().contains(clientRole)) {
return true;
}
+ } catch (PulsarAdminException.NotFoundException e) {
+
+ }
}
// check if role has permissions granted
