diff --git a/CHANGELOG.md b/CHANGELOG.md index eeef14722da..442ed7ae33c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/pkg/scalers/datadog_scaler.go b/pkg/scalers/datadog_scaler.go index 559e3f47198..f3c2ab131a6 100644 --- a/pkg/scalers/datadog_scaler.go +++ b/pkg/scalers/datadog_scaler.go @@ -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") }