Skip to content

Commit

Permalink
Merge pull request #1107 from hebelsan/hotfix-nil
Browse files Browse the repository at this point in the history
Fix nil check after getting route table
  • Loading branch information
hebelsan authored Oct 29, 2024
2 parents 76372a6 + 40d55c8 commit a0af403
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/controller/infrastructure/infraflow/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -1362,10 +1362,13 @@ func (c *FlowContext) deleteZoneRoutingTableAssociation(ctx context.Context, zon
if err != nil {
return err
}
for _, assoc := range routeTable.Associations {
if reflect.DeepEqual(subnetID, assoc.SubnetId) {
assocID = &assoc.RouteTableAssociationId
break
// if not found routeTable might be nil
if routeTable != nil {
for _, assoc := range routeTable.Associations {
if reflect.DeepEqual(subnetID, assoc.SubnetId) {
assocID = &assoc.RouteTableAssociationId
break
}
}
}
}
Expand Down

0 comments on commit a0af403

Please sign in to comment.