diff --git a/spec.go b/spec.go index 806d2f15f..d03d644e2 100644 --- a/spec.go +++ b/spec.go @@ -2,6 +2,7 @@ package main import ( "encoding/json" + "errors" "fmt" "os" @@ -126,6 +127,9 @@ func loadSpec(cPath string) (spec *specs.Spec, err error) { if err = json.NewDecoder(cf).Decode(&spec); err != nil { return nil, err } + if spec == nil { + return nil, errors.New("config cannot be null") + } return spec, validateProcessSpec(spec.Process) }