Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1788 from grafana/as-percent-panic-on-empty-input
Browse files Browse the repository at this point in the history
asPercent: don't panic on empty input
  • Loading branch information
Dieterbe authored Apr 17, 2020
2 parents 3265087 + 65452ba commit 4c2b3a8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions expr/func_aspercent.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ func (s *FuncAsPercent) execWithNodes(in, totals []models.Series, dataMap DataMa
// * multiple series -> must match len(series), sort and match up in pairs to input series
// * nil -> generate total by summing the inputs
func (s *FuncAsPercent) execWithoutNodes(in, totals []models.Series, dataMap DataMap) ([]models.Series, error) {
if len(in) == 0 {
return in, nil
}
var outSeries []models.Series
var totalsSerie models.Series
if math.IsNaN(s.totalFloat) && totals == nil {
Expand Down

0 comments on commit 4c2b3a8

Please sign in to comment.