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() {
|
||||
IndexSchema schema = req.getSchema();
|
||||
SchemaField sf = schema.getUniqueKeyField();
|
||||
if (solrDoc != null && sf != null) {
|
||||
SolrInputField field = solrDoc.getField(sf.getName());
|
||||
if (field != null) {
|
||||
return field.getFirstValue().toString();
|
||||
}
|
||||
}
|
||||
if (req != null) {
|
||||
IndexSchema schema = req.getSchema();
|
||||
SchemaField sf = schema.getUniqueKeyField();
|
||||
if (solrDoc != null && sf != null) {
|
||||
SolrInputField field = solrDoc.getField(sf.getName());
|
||||
if (field != null) {
|
||||
return field.getFirstValue().toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
return "(null)";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue