Skip to content

Commit

Permalink
Fix: panic in datadog scaler
Browse files Browse the repository at this point in the history
Signed-off-by: Valentin Flaux <vflaux@oui.sncf>
  • Loading branch information
vflaux committed Aug 31, 2022
1 parent 96e5bd2 commit 6762b32
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ To learn more about our roadmap, we recommend reading [this document](ROADMAP.md
### Fixes

- **General:** Metrics endpoint returns correct HPA values ([#3554](https://github.com/kedacore/keda/issues/3554))
- **Datadog Scaler:** Fix: panic in datadog scaler ([#3448](https://github.com/kedacore/keda/issues/3448))

### Deprecations

Expand Down
2 changes: 1 addition & 1 deletion pkg/scalers/datadog_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func (s *datadogScaler) getQueryResult(ctx context.Context) (float64, error) {
points := series[0].GetPointlist()

index := len(points) - 1
if len(points) == 0 || len(points[index]) < 2 {
if len(points) == 0 || len(points[index]) < 2 || points[index][1] == nil {
if !s.metadata.useFiller {
return 0, fmt.Errorf("no Datadog metrics returned for the given time window")
}
Expand Down

0 comments on commit 6762b32

Please sign in to comment.