Fixing index out of range during exec of container

Signed-off-by: rajasec <rajasec79@gmail.com>

Fixed review comments

Signed-off-by: rajasec <rajasec79@gmail.com>

updated the arguments check as per review comment

Signed-off-by: rajasec <rajasec79@gmail.com>
This commit is contained in:
rajasec 2016-04-09 23:12:54 +05:30
parent d14b04a331
commit c3cc4b36ba
1 changed files with 4 additions and 0 deletions

View File

@ -99,6 +99,10 @@ func execProcess(context *cli.Context) (int, error) {
if err != nil {
return -1, err
}
path := context.String("process")
if path == "" && len(context.Args()) == 1 {
return -1, fmt.Errorf("process args cannot be empty")
}
detach := context.Bool("detach")
state, err := container.State()
if err != nil {