madrob commented on code in PR #825:
URL: https://github.com/apache/solr/pull/825#discussion_r861093521


##########
solr/core/src/java/org/apache/solr/cloud/ZkConfigSetService.java:
##########
@@ -233,10 +233,14 @@ public void setConfigMetadata(String configName, 
Map<String, Object> data) throw
   @Override
   public Map<String, Object> getConfigMetadata(String configName) throws 
IOException {
     try {
+
+      byte[] bytedata = zkClient.getData(CONFIGS_ZKNODE + "/" + configName, 
null, null, true);
+      if (bytedata == null) return new HashMap<>();
+
       @SuppressWarnings("unchecked")
       Map<String, Object> data =
           (Map<String, Object>)
-              Utils.fromJSON(zkClient.getData(CONFIGS_ZKNODE + "/" + 
configName, null, null, true));
+              Utils.fromJSON(bytedata);

Review Comment:
   Maybe this should instead make `Utils.fromJSON` to be more lenient and allow 
`null array->empty map`?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to