From 83f8ed8634fe9c27ef09ce6deb3742586a2138a2 Mon Sep 17 00:00:00 2001 From: Noble Paul Date: Tue, 2 May 2017 17:55:40 +0930 Subject: [PATCH] SOLR-10278: avoid NPE --- .../apache/solr/client/solrj/impl/SolrClientDataProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientDataProvider.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientDataProvider.java index 929563b0158..d283d7b1966 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientDataProvider.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientDataProvider.java @@ -22,6 +22,7 @@ import java.io.IOException; import java.lang.invoke.MethodHandles; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -98,7 +99,7 @@ public class SolrClientDataProvider implements ClusterDataProvider { @Override public Map>> getReplicaInfo(String node, Collection keys) { - return data.get(node);//todo fill other details + return data.getOrDefault(node, Collections.emptyMap());//todo fill other details } @Override