SOLR-11484: fixing NPE

This commit is contained in:
Noble Paul 2017-10-28 11:57:42 +10:30
parent 64f60e5cec
commit f1a6b68d75
1 changed files with 6 additions and 4 deletions

View File

@ -922,10 +922,12 @@ public class CloudSolrClient extends SolrClient {
// so that the next attempt would fetch the fresh state
// just re-read state for all of them, if it has not been retried
// in retryExpiryTime time
for (DocCollection ext : requestedCollections) {
ExpiringCachedDocCollection cacheEntry = collectionStateCache.get(ext.getName());
if (cacheEntry == null) continue;
cacheEntry.maybeStale = true;
if (requestedCollections != null) {
for (DocCollection ext : requestedCollections) {
ExpiringCachedDocCollection cacheEntry = collectionStateCache.get(ext.getName());
if (cacheEntry == null) continue;
cacheEntry.maybeStale = true;
}
}
if (retryCount < MAX_STALE_RETRIES) {//if it is a communication error , we must try again
//may be, we have a stale version of the collection state