This is an automated email from the ASF dual-hosted git repository.

technoboy pushed a commit to branch branch-2.11
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-2.11 by this push:
     new 1255379ed90 [improve][admin] Return BAD_REQUEST on cluster data is 
null for createCluster (#20346)
1255379ed90 is described below

commit 1255379ed90c447639737b09804558fa33c74f9c
Author: tison <[email protected]>
AuthorDate: Thu May 18 23:19:10 2023 +0800

    [improve][admin] Return BAD_REQUEST on cluster data is null for 
createCluster (#20346)
---
 .../main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java    | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java
 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java
index 7797f5dcaac..b16fa7f3432 100644
--- 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java
+++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java
@@ -158,6 +158,9 @@ public class ClustersBase extends AdminResource {
                 .thenCompose(__ -> validatePoliciesReadOnlyAccessAsync())
                 .thenCompose(__ -> {
                     NamedEntity.checkName(cluster);
+                    if (clusterData == null) {
+                        throw new RestException(Status.BAD_REQUEST, "cluster 
data is required");
+                    }
                     return clusterResources().getClusterAsync(cluster);
                 }).thenCompose(clusterOpt -> {
                     if (clusterOpt.isPresent()) {

Reply via email to