fix: check if type assertion of return value is valid

pull/59/head
sammy 2021-05-11 18:59:54 -04:00
parent accd4beeba
commit 0f9d3732fb
No known key found for this signature in database
GPG Key ID: 50EE40A2809851F5
1 changed files with 2 additions and 2 deletions

View File

@ -60,8 +60,8 @@ func RunInput(input string) {
l.Pop(1)
if luaexitcode != lua.LNil {
exitcode = luaexitcode.(lua.LNumber)
if code, ok := luaexitcode.(lua.LNumber); luaexitcode != lua.LNil && ok {
exitcode = code
}
if err != nil {
fmt.Fprintln(os.Stderr,