Skip to content

Commit

Permalink
throw IAE if fieldname is null - Closes #2711
Browse files Browse the repository at this point in the history
  • Loading branch information
s1monw committed Mar 3, 2013
1 parent a968db9 commit 3acca65
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.elasticsearch.search.sort;

import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.ElasticSearchIllegalArgumentException;

import java.io.IOException;

Expand All @@ -42,6 +43,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 3acca65

Please sign in to comment.