You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "David Arthur (JIRA)" <ji...@apache.org> on 2013/03/19 13:31:15 UTC
[jira] [Created] (SOLR-4614) ClusterState#getSlices returns null
causing NPE in ClientUtils#addSlices
David Arthur created SOLR-4614:
----------------------------------
Summary: ClusterState#getSlices returns null causing NPE in ClientUtils#addSlices
Key: SOLR-4614
URL: https://issues.apache.org/jira/browse/SOLR-4614
Project: Solr
Issue Type: Bug
Components: clients - java, SolrCloud
Affects Versions: 4.1
Reporter: David Arthur
Priority: Minor
When my program sends an UpdateRequest to a collection that has been deleted, I am getting a NPE
{code}
java.lang.NullPointerException
at org.apache.solr.client.solrj.util.ClientUtils.addSlices(ClientUtils.java:273)
at org.apache.solr.client.solrj.impl.CloudSolrServer.request(CloudSolrServer.java:214)
at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:117)
{code}
This appears to be caused by the fact that ClusterState#getSlices is returning null instead of an empty collection.
ClusterState returning null: https://github.com/apache/lucene-solr/blob/lucene_solr_4_1/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java#L123
ClientUtil#addSlices iterating over a null: https://github.com/apache/lucene-solr/blob/lucene_solr_4_1/solr/solrj/src/java/org/apache/solr/client/solrj/util/ClientUtils.java#L273
I would attach a patch, but I'm not sure what the preferred style is within the project (empty collection vs null checks).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org