Skip to content
Browse files

Avoid null result returned

  • Loading branch information...
1 parent 379597f commit 3cdb21a98b873d9811cbe88d5a3be26a1fc587d5 @killme2008 committed Apr 26, 2012
View
8 ...hosis-client/src/main/java/com/taobao/metamorphosis/client/MetaMessageSessionFactory.java
@@ -591,7 +591,13 @@ public StatsResult getStats(InetSocketAddress target) throws InterruptedExceptio
if (this.metaZookeeper != null) {
List<String> topics = new ArrayList<String>(1);
topics.add(topic);
- return this.metaZookeeper.getPartitionsForTopicsFromMaster(topics).get(topic);
+ List<Partition> rt = this.metaZookeeper.getPartitionsForTopicsFromMaster(topics).get(topic);
+ if (rt == null) {
+ return Collections.emptyList();
+ }
+ else {
+ return rt;
+ }
}
else {
throw new IllegalStateException("Could not talk with zookeeper to get partitions list");

0 comments on commit 3cdb21a

Please sign in to comment.
Something went wrong with that request. Please try again.