From 2086a1ec784f0b82824733dbd521c142cfc6d5b3 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Mon, 28 Mar 2022 17:43:21 -0400 Subject: [PATCH] fix: handle panic in lua input if it is incorrect --- exec.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exec.go b/exec.go index 1556685..fc34625 100644 --- a/exec.go +++ b/exec.go @@ -114,7 +114,9 @@ func handleLua(cmdString string) (uint8, error) { } // And if there's no syntax errors and -n isnt provided, run if !noexecute { - _, err = rt.Call1(l.MainThread(), rt.FunctionValue(chunk)) + if chunk != nil { + _, err = rt.Call1(l.MainThread(), rt.FunctionValue(chunk)) + } } if err == nil { return 0, nil