mirror of https://github.com/apache/lucene.git
SOLR-5509: fix possible npe
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1546189 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2939fce489
commit
e54b08e2ab
|
@ -109,14 +109,16 @@ public class AddUpdateCommand extends UpdateCommand implements Iterable<IndexDoc
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPrintableId() {
|
public String getPrintableId() {
|
||||||
IndexSchema schema = req.getSchema();
|
if (req != null) {
|
||||||
SchemaField sf = schema.getUniqueKeyField();
|
IndexSchema schema = req.getSchema();
|
||||||
if (solrDoc != null && sf != null) {
|
SchemaField sf = schema.getUniqueKeyField();
|
||||||
SolrInputField field = solrDoc.getField(sf.getName());
|
if (solrDoc != null && sf != null) {
|
||||||
if (field != null) {
|
SolrInputField field = solrDoc.getField(sf.getName());
|
||||||
return field.getFirstValue().toString();
|
if (field != null) {
|
||||||
}
|
return field.getFirstValue().toString();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return "(null)";
|
return "(null)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue