SOLR-8340: Fixed NullPointerException in HighlightComponent.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1716911 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Christine Poerschke 2015-11-27 20:01:25 +00:00
parent 19b101566d
commit e32f6e5e67
2 changed files with 7 additions and 0 deletions

View File

@ -188,6 +188,9 @@ Other Changes
* LUCENE-6900: Added test for score ordered grouping, and refactored TopGroupsResultTransformer.
(David Smiley)
* SOLR-8340: Fixed NullPointerException in HighlightComponent.
(zengjie via Christine Poerschke)
================== 5.4.0 ==================

View File

@ -190,6 +190,10 @@ public class HighlightComponent extends SearchComponent implements PluginInfoIni
for (int i=0; i<hl.size(); i++) {
String id = hl.getName(i);
ShardDoc sdoc = rb.resultIds.get(id);
// sdoc maybe null
if (sdoc == null) {
continue;
}
int idx = sdoc.positionInResponse;
arr[idx] = new NamedList.NamedListEntry<>(id, hl.getVal(i));
}