fix get partitioned metadata  throws NullPointerException
Master Issue:
## Motivation
Sometimes get partitioned metadata will throws NullPointerException, because the NamespaceService not initialized yet , so needed a judgment .
## Modifications
BrokerService
```java
if(pulsar.getNamespaceService() == null){
return CompletableFuture.completedFuture(null);
}
```
@@ -1941,6 +1941,9 @@ public class BrokerService implements Closeable, ZooKeeperCacheListener<Policies
}
public CompletableFuture<PartitionedTopicMetadata> fetchPartitionedTopicMetadataCheckAllowAutoCreationAsync(TopicName topicName) {
+ if(pulsar.getNamespaceService() == null){
+ return FutureUtil.failedFuture(new NullPointerException("namespaceService is null"));
+ }
return pulsar.getNamespaceService().checkTopicExists(topicName)
.thenCompose(topicExists -> {
return fetchPartitionedTopicMetadataAsync(topicName)
