From 2a54d8304b6ffe7c5dc9be7974b3506b2bf53b19 Mon Sep 17 00:00:00 2001 From: James Kwon Date: Mon, 21 Aug 2023 22:07:59 -0400 Subject: [PATCH] Fix nil pointer when first seen tag is nil --- aws/resources/opensearch.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/resources/opensearch.go b/aws/resources/opensearch.go index e51ca264..63c2dc9b 100644 --- a/aws/resources/opensearch.go +++ b/aws/resources/opensearch.go @@ -36,10 +36,10 @@ func (osd *OpenSearchDomains) getAll(configObj config.Config) ([]*string, error) return nil, errors.WithStackTrace(err) } - if firstSeenTime.IsZero() { + if firstSeenTime == nil { err := osd.setFirstSeenTag(domain.ARN, time.Now().UTC()) if err != nil { - logging.Logger.Errorf("Error tagging the OpenSearch Domain with ARN %s", aws.StringValue(domain.ARN)) + logging.Logger.Errorf("Error tagging the OpenSearch Domain with ARN %s with error: %s", aws.StringValue(domain.ARN), err.Error()) return nil, errors.WithStackTrace(err) } }