2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-04-02 19:53:23 +00:00

fix: check if type assertion of return value is valid

This commit is contained in:
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

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,