diff --git a/pkg/vm/cli/cli.go b/pkg/vm/cli/cli.go index aff236da2..0045f12f4 100644 --- a/pkg/vm/cli/cli.go +++ b/pkg/vm/cli/cli.go @@ -404,6 +404,10 @@ func handleRun(c *ishell.Context) { v.Estack().PushVal(params[i]) } if runCurrent { + if !v.Ready() { + c.Err(fmt.Errorf("no program loaded")) + return + } v.Jump(v.Context(), offset) if initMD := m.ABI.GetMethod(manifest.MethodInit, 0); initMD != nil { v.Call(v.Context(), initMD.Offset)