Skip to content

Commit

Permalink
return nil, not partially filled array in case of err. Also fill arra…
Browse files Browse the repository at this point in the history
…y only if no error
  • Loading branch information
rajagopalans committed Sep 29, 2023
1 parent a236f32 commit f4fb454
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apstra/two_stage_l3_clos_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,10 @@ func (o *TwoStageL3ClosClient) GetAllIbaWidgets(ctx context.Context) ([]IbaWidge
widgets := make([]IbaWidget, len(rawWidgets))
for i, w := range rawWidgets {
pw, err := w.polish()
widgets[i] = *pw
if err != nil {
return widgets, err
return nil, err
}
widgets[i] = *pw
}

return widgets, nil
Expand Down Expand Up @@ -655,10 +655,10 @@ func (o *TwoStageL3ClosClient) GetAllIbaDashboards(ctx context.Context) ([]IbaDa
dashes := make([]IbaDashboard, len(rawDashes))
for i, w := range rawDashes {
pw, err := w.polish()
dashes[i] = *pw
if err != nil {
return dashes, err
return nil, err
}
dashes[i] = *pw
}

return dashes, nil
Expand Down

0 comments on commit f4fb454

Please sign in to comment.