mirror of https://github.com/Hilbis/Hilbish
fix: check if type assertion of return value is valid
parent
accd4beeba
commit
0f9d3732fb
4
shell.go
4
shell.go
|
@ -60,8 +60,8 @@ func RunInput(input string) {
|
||||||
|
|
||||||
l.Pop(1)
|
l.Pop(1)
|
||||||
|
|
||||||
if luaexitcode != lua.LNil {
|
if code, ok := luaexitcode.(lua.LNumber); luaexitcode != lua.LNil && ok {
|
||||||
exitcode = luaexitcode.(lua.LNumber)
|
exitcode = code
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr,
|
fmt.Fprintln(os.Stderr,
|
||||||
|
|
Loading…
Reference in New Issue