From 3c87567a9e2c7928dbf439126be4a9f52a42ccdb Mon Sep 17 00:00:00 2001 From: Erik Kristensen Date: Sat, 20 Jul 2024 09:43:17 -0600 Subject: [PATCH] fix(rds-snapshot): protect against nil pointer --- resources/rds-snapshots.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/rds-snapshots.go b/resources/rds-snapshots.go index f16d1eaa..d3c87cd0 100644 --- a/resources/rds-snapshots.go +++ b/resources/rds-snapshots.go @@ -99,8 +99,11 @@ func (i *RDSSnapshot) Properties() types.Properties { Set("Identifier", i.snapshot.DBSnapshotIdentifier). Set("SnapshotType", i.snapshot.SnapshotType). Set("Status", i.snapshot.Status). - Set("AvailabilityZone", i.snapshot.AvailabilityZone). - Set("CreatedTime", i.snapshot.SnapshotCreateTime.Format(time.RFC3339)) + Set("AvailabilityZone", i.snapshot.AvailabilityZone) + + if i.snapshot != nil && i.snapshot.SnapshotCreateTime != nil { + properties.Set("CreatedTime", i.snapshot.SnapshotCreateTime.Format(time.RFC3339)) + } for _, tag := range i.tags { properties.SetTag(tag.Key, tag.Value)