Skip to content

Commit

Permalink
Check length of firmware set before returning 1st element
Browse files Browse the repository at this point in the history
  • Loading branch information
ofaurax committed Jan 13, 2025
1 parent 5610c35 commit 6ec6c79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/get/firmware-set.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func firmwareSetForServer(ctx context.Context, client *fleetdbapi.Client, server
return nil, err
}

if fwSet == nil {
if len(fwSet) == 0 { // len(nil) is also 0
return nil, errors.Wrap(
errNotFound,
fmt.Sprintf("vendor: %s, model: %s", vendor, model),
Expand Down

0 comments on commit 6ec6c79

Please sign in to comment.