Skip to content

Commit

Permalink
fix(child-additions): return child addition error if not nil
Browse files Browse the repository at this point in the history
  • Loading branch information
reubenmiller committed Apr 21, 2024
1 parent 7faa9a8 commit e853b18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/c8y/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ func (s *InventoryService) CreateChildAdditionWithBinary(ctx context.Context, pa
}

// Add binary as child addition to managed object
if childMO, childResp, childErr := s.client.Inventory.AddChildAddition(ctx, mo.ID, binary.ID); err != nil {
if childMO, childResp, childErr := s.client.Inventory.AddChildAddition(ctx, mo.ID, binary.ID); childErr != nil {
return childMO, childResp, childErr
}
return mo, resp, err
Expand All @@ -636,7 +636,7 @@ func (s *InventoryService) CreateWithBinary(ctx context.Context, binaryFile bina
}

// Add binary as child addition to managed object
if childMO, childResp, childErr := s.client.Inventory.AddChildAddition(ctx, mo.ID, binary.ID); err != nil {
if childMO, childResp, childErr := s.client.Inventory.AddChildAddition(ctx, mo.ID, binary.ID); childErr != nil {
return childMO, childResp, childErr
}
return mo, resp, err
Expand Down

0 comments on commit e853b18

Please sign in to comment.