Skip to content

Commit

Permalink
improve loop
Browse files Browse the repository at this point in the history
  • Loading branch information
lubedacht committed Jan 15, 2024
1 parent 8092523 commit e74e0a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/service/cloud/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ func (s *Service) GetLAN() (*sdk.Lan, error) {
return nil, fmt.Errorf("could not list LANs in datacenter %s: %w", s.dataCenterID(), err)
}

expectedName := s.LANName()
for _, l := range *lans.Items {
if name := l.Properties.Name; name != nil && *l.Properties.Name == s.LANName() {
if l.Properties.HasName() && *l.Properties.Name == expectedName {
return &l, nil
}
}
Expand Down

0 comments on commit e74e0a8

Please sign in to comment.