From 80bb52ef4ebb50bf2935fd5be62de009199b2194 Mon Sep 17 00:00:00 2001 From: Jorge Turrado Date: Thu, 19 Jan 2023 15:23:23 +0100 Subject: [PATCH] fix: Add missing error check Signed-off-by: Jorge Turrado --- pkg/scalers/azure_eventhub_scaler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/scalers/azure_eventhub_scaler.go b/pkg/scalers/azure_eventhub_scaler.go index 514149fa543..88b206232f2 100644 --- a/pkg/scalers/azure_eventhub_scaler.go +++ b/pkg/scalers/azure_eventhub_scaler.go @@ -269,7 +269,7 @@ func parseAzureEventHubAuthenticationMetadata(logger logr.Logger, config *Scaler // GetUnprocessedEventCountInPartition gets number of unprocessed events in a given partition func (s *azureEventHubScaler) GetUnprocessedEventCountInPartition(ctx context.Context, partitionInfo *eventhub.HubPartitionRuntimeInformation) (newEventCount int64, checkpoint azure.Checkpoint, err error) { // if partitionInfo.LastEnqueuedOffset = -1, that means event hub partition is empty - if partitionInfo != nil && partitionInfo.LastEnqueuedOffset == "-1" { + if partitionInfo == nil || partitionInfo.LastEnqueuedOffset == "-1" { return 0, azure.Checkpoint{}, nil }