Skip to content

Commit

Permalink
models: NewPoint: reject fields with empty names.
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Seymour <jon@wildducktheories.com>
  • Loading branch information
jonseymour committed Feb 17, 2016
1 parent a06ff06 commit 20d3c96
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/points.go
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,9 @@ func NewPoint(name string, tags Tags, fields Fields, time time.Time) (Point, err
return nil, fmt.Errorf("NaN is an unsupported value for field %s", key)
}
}
if len(key) == 0 {
return nil, fmt.Errorf("All fields must have non-empty names")
}
}

return &point{
Expand Down

0 comments on commit 20d3c96

Please sign in to comment.