diff --git a/pkg/cli/zadig-agent/internal/agent/step/step.go b/pkg/cli/zadig-agent/internal/agent/step/step.go index d24c0fc44e..d983e6b4ad 100644 --- a/pkg/cli/zadig-agent/internal/agent/step/step.go +++ b/pkg/cli/zadig-agent/internal/agent/step/step.go @@ -18,6 +18,7 @@ package step import ( "context" + "errors" "fmt" "github.com/koderover/zadig/v2/pkg/cli/zadig-agent/helper/log" @@ -48,6 +49,11 @@ func RunStep(ctx context.Context, jobCtx *jobctl.JobContext, step *commonmodels. var stepInstance Step var err error + if step == nil { + log.Errorf("step is nil") + return errors.New("step is nil") + } + switch step.StepType { case "batch_file": stepInstance, err = script.NewBatchFileStep(jobCtx.Outputs, step.Spec, dirs, envs, secretEnvs, logger)