Skip to content

Commit 598e0e8

Browse files
authored
Merge pull request #4453 from paralin/fix-nil-reference
fix: nil pointer dereference panic in shellAction
2 parents 26bfd15 + 4aa3d95 commit 598e0e8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/limactl/shell.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ func shellAction(cmd *cobra.Command, args []string) error {
9494
}
9595
return err
9696
}
97+
if inst.Config == nil {
98+
if len(inst.Errors) > 0 {
99+
return fmt.Errorf("instance %q has configuration errors: %w", instName, errors.Join(inst.Errors...))
100+
}
101+
return fmt.Errorf("instance %q has no configuration", instName)
102+
}
97103
if inst.Status == limatype.StatusStopped {
98104
startNow, err := flags.GetBool("start")
99105
if err != nil {

0 commit comments

Comments
 (0)