Skip to content

Commit

Permalink
Fix panic when loading call args return an error
Browse files Browse the repository at this point in the history
  • Loading branch information
CannibalVox committed Apr 10, 2020
1 parent e587b9c commit 58ef854
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions local_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ func (f *LocalLuaFunction) Call(args ...interface{}) ([]interface{}, error) {
var err error
for ind, arg := range args {
val, err := fromGoValue(f.HomeVM(), arg, nil)
if val.temporary == C._Bool(true) {
defer C.free_temporary_lua_value(f.HomeVM()._l, val)
}
if err != nil {
break
}
if val.temporary == C._Bool(true) {
defer C.free_temporary_lua_value(f.HomeVM()._l, val)
}

argsIn[ind] = val
}
Expand Down

0 comments on commit 58ef854

Please sign in to comment.