diff --git a/pkg/compiler/codegen.go b/pkg/compiler/codegen.go index 17b0197d7..e16b59087 100644 --- a/pkg/compiler/codegen.go +++ b/pkg/compiler/codegen.go @@ -2185,6 +2185,9 @@ func newCodegen(info *buildInfo, pkg *packages.Package) *codegen { // codeGen compiles the program to bytecode. func codeGen(info *buildInfo) (*nef.File, *DebugInfo, error) { + if len(info.program) == 0 { + return nil, nil, errors.New("empty package") + } pkg := info.program[0] c := newCodegen(info, pkg)