Skip to content

Commit

Permalink
return early when err != nil
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmad Karimi <[email protected]>
  • Loading branch information
therealak12 committed Oct 5, 2023
1 parent 23223e8 commit 4d7b9c4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/contour/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -1224,9 +1224,10 @@ func (s *Server) informOnResource(obj client.Object, handler cache.ResourceEvent

registration, err := inf.AddEventHandler(handler)

if err == nil {
s.handlerCacheSyncs = append(s.handlerCacheSyncs, registration.HasSynced)
if err != nil {
return err
}

return err
s.handlerCacheSyncs = append(s.handlerCacheSyncs, registration.HasSynced)
return nil
}

0 comments on commit 4d7b9c4

Please sign in to comment.