Skip to content

Commit 9a0282f

Browse files
authored
Fix panic calling tanzu package installed status (#1161)
* Fix panic calling tanzu package installed status Calling tanzu package installed status without any arguments causes the program to panic. Signed-off-by: Borja Clemente <[email protected]> * Apply review feedback Signed-off-by: Borja Clemente <[email protected]> --------- Signed-off-by: Borja Clemente <[email protected]>
1 parent 15c92de commit 9a0282f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cli/pkg/kctrl/cmd/package/installed/status.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ func NewStatusCmd(o *StatusOptions, flagsFactory cmdcore.FlagsFactory) *cobra.Co
6161

6262
func (o *StatusOptions) Run(args []string) error {
6363
if o.pkgCmdTreeOpts.PositionalArgs {
64-
o.Name = args[0]
64+
if len(args) > 0 {
65+
o.Name = args[0]
66+
}
6567
}
6668

6769
if len(o.Name) == 0 {

0 commit comments

Comments
 (0)