Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

fix: Check For Nil #1223

Merged
merged 2 commits into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions resources/services/backup/plans.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,9 @@ func fetchBackupSelections(ctx context.Context, meta schema.ClientMeta, parent *

func fetchPlanRules(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error {
plan := parent.Item.(backup.GetBackupPlanOutput)
if plan.BackupPlan == nil {
return nil
}
res <- plan.BackupPlan.Rules
return nil
}
Expand Down
10 changes: 10 additions & 0 deletions resources/services/cloudfront/distributions.go
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,16 @@ func resolveCloudfrontDistributionsAliasIcpRecordals(ctx context.Context, meta s
}
func fetchCloudfrontDistributionDefaultCacheBehaviorLambdaFunctions(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error {
r := parent.Item.(types.Distribution)
if r.DistributionConfig == nil {
return nil
}
if r.DistributionConfig.DefaultCacheBehavior == nil {
return nil
}
if r.DistributionConfig.DefaultCacheBehavior.LambdaFunctionAssociations == nil {
return nil
}

res <- r.DistributionConfig.DefaultCacheBehavior.LambdaFunctionAssociations.Items
return nil
}
Expand Down
3 changes: 3 additions & 0 deletions resources/services/codepipeline/webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ func fetchCodepipelineWebhooks(ctx context.Context, meta schema.ClientMeta, pare
}
func fetchCodepipelineWebhookFilters(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error {
r := parent.Item.(types.ListWebhookItem)
if r.Definition == nil {
return nil
}
res <- r.Definition.Filters
return nil
}
3 changes: 3 additions & 0 deletions resources/services/dms/replication_instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ func fetchDmsReplicationInstances(ctx context.Context, meta schema.ClientMeta, _

func fetchDmsReplicationInstanceReplicationSubnetGroupSubnets(_ context.Context, _ schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error {
replicationInstance := parent.Item.(DmsReplicationInstanceWrapper)
if replicationInstance.ReplicationSubnetGroup == nil {
return nil
}
res <- replicationInstance.ReplicationSubnetGroup.Subnets
return nil
}
Expand Down
3 changes: 3 additions & 0 deletions resources/services/eks/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ func fetchEksClusterEncryptionConfigs(ctx context.Context, meta schema.ClientMet
}
func fetchEksClusterLoggings(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error {
p := parent.Item.(*types.Cluster)
if p.Logging == nil {
return nil
}
res <- p.Logging.ClusterLogging
return nil
}
Expand Down