Skip to content

Commit

Permalink
throw IAE if fieldname is null - Closes elastic#2711
Browse files Browse the repository at this point in the history
  • Loading branch information
s1monw committed Feb 28, 2013
1 parent c90c5cb commit 8b6a5bf
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.query.FilterBuilder;
import org.elasticsearch.ElasticSearchIllegalArgumentException;

import java.io.IOException;

Expand Down Expand Up @@ -49,6 +50,9 @@ public class FieldSortBuilder extends SortBuilder {
* @param fieldName The field name.
*/
public FieldSortBuilder(String fieldName) {
if (fieldName == null) {
throw new ElasticSearchIllegalArgumentException("fieldName must not be null");
}
this.fieldName = fieldName;
}

Expand Down

0 comments on commit 8b6a5bf

Please sign in to comment.