Skip to content

Commit

Permalink
error handling to avoid panic
Browse files Browse the repository at this point in the history
Signed-off-by: ashish <ashishjaitiwari15112000@gmail.com>
  • Loading branch information
Revolyssup committed Sep 27, 2021
1 parent 94f392a commit df0c58c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions adapter/oam.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ func RegisterWorkLoadsDynamically(runtime, host string, dc *DynamicComponentsCon
if err != nil {
return ErrGenerateComponents(err)
}
if comp == nil {
return ErrGenerateComponents(errors.New("failed to generate components"))
}
for i, def := range comp.Definitions {
var ord OAMRegistrantData
ord.OAMRefSchema = comp.Schemas[i]
Expand Down

0 comments on commit df0c58c

Please sign in to comment.