From e27458faf9a34710c7e283c6c99de1db2aafbafd Mon Sep 17 00:00:00 2001 From: Sean Linsley Date: Mon, 2 Dec 2024 10:49:02 -0600 Subject: [PATCH] Improve error handling for Azure system stats --- input/system/azure/system.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/system/azure/system.go b/input/system/azure/system.go index 68666d31d..107ba5fb2 100644 --- a/input/system/azure/system.go +++ b/input/system/azure/system.go @@ -205,7 +205,7 @@ func GetSystemState(ctx context.Context, server *state.Server, logger *util.Logg for _, metric := range metricsRes.Value { // Should be only one data as 1 min time span with 1 min interval is selected, so getting first metric is good metricValue := getFirstMetricValue(metric) - if metricValue.Average == nil { + if metricValue == nil || metricValue.Average == nil { continue } switch *metric.Name.Value {