fix sort metric item null reference
This commit is contained in:
parent
503b201eb2
commit
fae481f790
|
@ -85,7 +85,7 @@ func (m *Metric) ValidateSortKey() error {
|
|||
if v, ok := mm[sortItem.Key]; !ok && !util.StringInArray([]string{"_key", "_count"}, sortItem.Key){
|
||||
return fmt.Errorf("unknown sort key [%s]", sortItem.Key)
|
||||
}else{
|
||||
if v.Statistic == "derivative" {
|
||||
if v != nil && v.Statistic == "derivative" {
|
||||
return fmt.Errorf("can not sort by pipeline agg [%s]", v.Statistic)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue