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:
Mark Robert Miller 2013-11-27 20:43:35 +00:00
parent 2939fce489
commit e54b08e2ab
1 changed files with 10 additions and 8 deletions

View File

@ -109,6 +109,7 @@ public class AddUpdateCommand extends UpdateCommand implements Iterable<IndexDoc
} }
public String getPrintableId() { public String getPrintableId() {
if (req != null) {
IndexSchema schema = req.getSchema(); IndexSchema schema = req.getSchema();
SchemaField sf = schema.getUniqueKeyField(); SchemaField sf = schema.getUniqueKeyField();
if (solrDoc != null && sf != null) { if (solrDoc != null && sf != null) {
@ -117,6 +118,7 @@ public class AddUpdateCommand extends UpdateCommand implements Iterable<IndexDoc
return field.getFirstValue().toString(); return field.getFirstValue().toString();
} }
} }
}
return "(null)"; return "(null)";
} }