diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-11-20 10:13:58 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-11-20 10:13:58 -0800 |
commit | 8a3e81b4b0d8365baa40ff1326ed4d13b34506dc (patch) | |
tree | a9ad614d6769c8e26c5ddabd9ed8175866992b41 /src/lua.c | |
parent | e693448b65721843e3d8dbfc978a9e4a95de5809 (diff) | |
download | teliva-8a3e81b4b0d8365baa40ff1326ed4d13b34506dc.tar.gz |
report errors when calling non-existent functions
Diffstat (limited to 'src/lua.c')
-rw-r--r-- | src/lua.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lua.c b/src/lua.c index 8d3a1a4..61836e6 100644 --- a/src/lua.c +++ b/src/lua.c @@ -295,11 +295,13 @@ static int handle_image (lua_State *L, char **argv, int n) { for (lua_pushnil(L); lua_next(L, table) != 0; lua_pop(L, 1)) { const char* key = lua_tostring(L, -2); const char* value = lua_tostring(L, -1); - dostring(L, value, key); + status = dostring(L, value, key); + if (status != 0) return report(L, status); } /* call main() */ lua_getglobal(L, "main"); - docall(L, 0, 1); + status = docall(L, 0, 1); + if (status != 0) return report(L, status); return 0; } |