Skip to content

Commit

Permalink
handle len(args) < 1 case
Browse files Browse the repository at this point in the history
Signed-off-by: Sjors Holtrop <[email protected]>
  • Loading branch information
sjorsholtrop-ritense committed Jan 14, 2025
1 parent 2e9e8e2 commit f29bcfb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/flux/resume.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ func (resume resumeCommand) patch(ctx context.Context, args []string, listOpts [
}

if resume.list.len() == 0 {
logger.Failuref("%s object '%s' not found in %s namespace", resume.kind, args[0], resume.namespace)
if len(args) < 1 {
logger.Failuref("no %s objects found in %s namespace", resume.kind, resume.namespace)
} else {
logger.Failuref("%s object '%s' not found in %s namespace", resume.kind, args[0], resume.namespace)
}
return nil, nil
}

Expand Down

0 comments on commit f29bcfb

Please sign in to comment.