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

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


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

commit ae73fac437e06e7709ff0f443066bff1bb0de220
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 e61a7f20d1d..5d4ed54c334 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
@@ -162,6 +162,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");
+                    }
                     try {
                         clusterData.checkPropertiesIfPresent();
                     } catch (IllegalArgumentException ex) {

Reply via email to