fix: handle panic in lua input if it is incorrect

lua5.4
TorchedSammy 2022-03-28 17:43:21 -04:00
parent d34aa09e8e
commit 2086a1ec78
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 3 additions and 1 deletions

View File

@ -114,8 +114,10 @@ func handleLua(cmdString string) (uint8, error) {
} }
// And if there's no syntax errors and -n isnt provided, run // And if there's no syntax errors and -n isnt provided, run
if !noexecute { if !noexecute {
if chunk != nil {
_, err = rt.Call1(l.MainThread(), rt.FunctionValue(chunk)) _, err = rt.Call1(l.MainThread(), rt.FunctionValue(chunk))
} }
}
if err == nil { if err == nil {
return 0, nil return 0, nil
} }