fix: return if runner did not return table

pull/276/merge
sammyette 2023-12-06 22:20:41 -04:00
parent 60fd4c3b4c
commit 1d64a57e24
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 3 additions and 0 deletions

View File

@ -175,6 +175,9 @@ func runLuaRunner(runr rt.Value, userInput string) (input string, exitCode uint8
runnerRet := term.Get(0) runnerRet := term.Get(0)
if runner, ok = runnerRet.TryTable(); !ok { if runner, ok = runnerRet.TryTable(); !ok {
fmt.Fprintln(os.Stderr, "runner did not return a table") fmt.Fprintln(os.Stderr, "runner did not return a table")
exitCode = 125
input = userInput
return
} }
if code, ok := runner.Get(rt.StringValue("exitCode")).TryInt(); ok { if code, ok := runner.Get(rt.StringValue("exitCode")).TryInt(); ok {