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

Commit

Permalink
fix: Check For Nil (#1223)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbernays authored Jul 18, 2022
1 parent 11f5e3b commit bb2c120
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
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

0 comments on commit bb2c120

Please sign in to comment.