muse-dev[bot] commented on a change in pull request #2010:
URL: https://github.com/apache/lucene-solr/pull/2010#discussion_r523248650



##########
File path: solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
##########
@@ -344,13 +344,8 @@ final private void doReplicateOnlyRecovery(SolrCore core) 
throws InterruptedExce
                                                                                
             // though
       try {
         CloudDescriptor cloudDesc = this.coreDescriptor.getCloudDescriptor();
-        ZkNodeProps leaderprops = zkStateReader.getLeaderRetry(
-            cloudDesc.getCollectionName(), cloudDesc.getShardId());
-        final String leaderBaseUrl = 
leaderprops.getStr(ZkStateReader.BASE_URL_PROP);
-        final String leaderCoreName = 
leaderprops.getStr(ZkStateReader.CORE_NAME_PROP);
-
-        String leaderUrl = ZkCoreNodeProps.getCoreUrl(leaderBaseUrl, 
leaderCoreName);
-
+        ZkNodeProps leaderprops = 
zkStateReader.getLeaderRetry(cloudDesc.getCollectionName(), 
cloudDesc.getShardId());
+        String leaderUrl = ZkCoreNodeProps.getCoreUrl(leaderprops);
         String ourUrl = ZkCoreNodeProps.getCoreUrl(baseUrl, coreName);
 
         boolean isLeader = leaderUrl.equals(ourUrl); // TODO: We can probably 
delete most of this code if we say this

Review comment:
       *NULL_DEREFERENCE:*  object `leaderUrl` last assigned on line 348 could 
be null and is dereferenced at line 351.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to