Skip to content

Commit 7a487f0

Browse files
fix: validate if command is specified (#1295)
1 parent 92531b2 commit 7a487f0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pkg/controller/apply.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ import (
1717

1818
// Apply sends the notification with notifier
1919
func (ctrl *Controller) Apply(ctx context.Context, command Command) error {
20+
if command.Cmd == "" {
21+
return errors.New("no command specified")
22+
}
2023
if err := platform.Complement(&ctrl.Config); err != nil {
2124
return err
2225
}

pkg/controller/plan.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import (
1818

1919
// Plan sends the notification with notifier
2020
func (ctrl *Controller) Plan(ctx context.Context, command Command) error {
21+
if command.Cmd == "" {
22+
return errors.New("no command specified")
23+
}
2124
if err := platform.Complement(&ctrl.Config); err != nil {
2225
return err
2326
}

0 commit comments

Comments
 (0)