NullPointerException for invalid faceted query, closes #1136.

This commit is contained in:
kimchy 2011-07-20 05:54:09 +03:00
parent c066b6ae4a
commit 0ed50ca00c
1 changed files with 4 additions and 0 deletions

View File

@ -127,6 +127,10 @@ public class FacetParseElement implements SearchParseElement {
facet = new NestedChildrenCollector(facet, context.filterCache().cache(NonNestedDocsFilter.INSTANCE), context.filterCache().cache(objectMapper.nestedTypeFilter())); facet = new NestedChildrenCollector(facet, context.filterCache().cache(NonNestedDocsFilter.INSTANCE), context.filterCache().cache(objectMapper.nestedTypeFilter()));
} }
if (facet == null) {
throw new SearchParseException(context, "no facet type found for facet named [" + topLevelFieldName + "]");
}
if (facetCollectors == null) { if (facetCollectors == null) {
facetCollectors = Lists.newArrayList(); facetCollectors = Lists.newArrayList();
} }