Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 507dbcc

Browse files
committed
Prevent potential panic if multierror is nil
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 4464bb5 commit 507dbcc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

cli/cmd/context/rm.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ func runRemove(ctx context.Context, args []string, force bool) error {
6969
errs = removeContext(s, contextName, errs)
7070
}
7171
}
72+
if errs == nil {
73+
return nil
74+
}
7275
return errs.ErrorOrNil()
7376
}
7477

cli/cmd/rm.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ func runRm(ctx context.Context, args []string, opts rmOpts) error {
6464
}
6565
fmt.Println(id)
6666
}
67-
67+
if errs == nil {
68+
return nil
69+
}
6870
return errs.ErrorOrNil()
6971
}

0 commit comments

Comments
 (0)