Skip to content

Commit

Permalink
Merge pull request #51 from reubenmiller/fix-child-addition-error-check
Browse files Browse the repository at this point in the history
fix(child-additions): return child addition error if not nil
  • Loading branch information
reubenmiller authored Apr 21, 2024
2 parents 7faa9a8 + e853b18 commit 5dfed0c
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 5dfed0c

Please sign in to comment.