Fix null pointer with invalid argument values

This commit is contained in:
Vikram Rangnekar 2019-04-21 01:08:51 -04:00
parent 5edcf7b3a9
commit 7c37a1ef63
1 changed files with 4 additions and 0 deletions

View File

@ -423,6 +423,10 @@ func (com *Compiler) compileArgNode(val *Node) (*Exp, error) {
st := util.NewStack() st := util.NewStack()
var root *Exp var root *Exp
if val == nil || len(val.Children) == 0 {
return nil, errors.New("invalid argument value")
}
st.Push(&expT{nil, val.Children[0]}) st.Push(&expT{nil, val.Children[0]})
for { for {