From 919a52a630150ca9b905506fbdf8dae761e8f741 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Sun, 17 Apr 2022 22:58:29 -0400 Subject: [PATCH] fix: handle syntax error in aliased command if an alias is something which isn't valid syntax, specifically if hilbish cant split up the input properly to execute, it will report the error to the user. the previous behaviour was a panic since on error the args slice will be of length 0 this is basically an edge case and fixes a bug which shouldnt happen normally --- exec.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exec.go b/exec.go index c548694..90498ab 100644 --- a/exec.go +++ b/exec.go @@ -220,7 +220,11 @@ func execHandle(bg bool) interp.ExecHandlerFunc { // If alias was found, use command alias argstring = aliases.Resolve(argstring) - args, _ = shell.Fields(argstring, nil) + var err error + args, err = shell.Fields(argstring, nil) + if err != nil { + return err + } } // If command is defined in Lua then run it