jianyun8023 commented on a change in pull request #9985: URL: https://github.com/apache/pulsar/pull/9985#discussion_r598122702
########## File path: pulsar-common/src/main/java/org/apache/pulsar/common/protocol/Commands.java ########## @@ -694,9 +694,11 @@ private static void convertSchema(SchemaInfo schemaInfo, Schema schema) { .setType(getSchemaType(schemaInfo.getType())); schemaInfo.getProperties().entrySet().stream().forEach(entry -> { - schema.addProperty() - .setKey(entry.getKey()) - .setValue(entry.getValue()); + if (entry.getKey() != null && entry.getValue() != null) { Review comment: Is it necessary to keep the key here to have a worthy situation? What do you think? ########## File path: pulsar-broker/src/test/java/org/apache/pulsar/schema/SchemaTest.java ########## @@ -205,4 +211,30 @@ public void testIsUsingAvroSchemaParser() { } } } + + @Test + public void testNullKeyValueProperty() throws PulsarAdminException, PulsarClientException { + final String tenant = PUBLIC_TENANT; + final String namespace = "test-namespace-" + randomName(16); + final String topicName = "test"; + + final String topic = TopicName.get( + TopicDomain.persistent.value(), + tenant, + namespace, + topicName).toString(); + admin.namespaces().createNamespace( + tenant + "/" + namespace, + Sets.newHashSet(CLUSTER_NAME)); + + final Map<String, String> map = new HashMap<>(); + map.put("key", null); Review comment: @BewareMyPower I just expect to solve the error in this case. The `value` of `map#put(key, value)` is `null`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org