Skip to content

Commit 0d28b64

Browse files
committed
Add error message on running of nil program
1 parent 195ac5b commit 0d28b64

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

vm/vm.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import (
1010
)
1111

1212
func Run(program *Program, env interface{}) (out interface{}, err error) {
13+
if program == nil {
14+
return nil, fmt.Errorf("program is nil")
15+
}
16+
1317
vm := NewVM(false)
1418

1519
defer func() {

0 commit comments

Comments
 (0)