mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-26 19:42:23 +00:00
Merge pull request #2645 from nspcc-dev/fix-vm-cli-panic
compiler: avoid panic on empty package list
This commit is contained in:
commit
ab577da2b5
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue