[lua] Fix gettop() usages
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
1ca55927f0
commit
f11c913bc4
2
client.c
2
client.c
|
@ -1288,7 +1288,7 @@ luaA_client_titlebar_set(lua_State *L)
|
|||
client_t **c = luaA_checkudata(L, 1, "client");
|
||||
titlebar_t **t = NULL;
|
||||
|
||||
if(lua_gettop(L) == 2)
|
||||
if(lua_gettop(L) == 2 && !lua_isnil(L, 2))
|
||||
{
|
||||
t = luaA_checkudata(L, 2, "titlebar");
|
||||
if(client_getbytitlebar(*t))
|
||||
|
|
3
lua.c
3
lua.c
|
@ -393,8 +393,9 @@ luaA_hooks_timer(lua_State *L)
|
|||
globalconf.timer.tv_usec = 0;
|
||||
globalconf.timer.tv_sec = luaL_checknumber(L, 1);
|
||||
|
||||
if(lua_gettop(L) == 2 && lua_isfunction(L, 2))
|
||||
if(lua_gettop(L) == 2 && !lua_isnil(L, 2))
|
||||
{
|
||||
luaA_checkfunction(L, 2);
|
||||
if(globalconf.hooks.timer)
|
||||
luaL_unref(L, LUA_REGISTRYINDEX, globalconf.hooks.timer);
|
||||
globalconf.hooks.timer = luaL_ref(L, LUA_REGISTRYINDEX);
|
||||
|
|
4
mouse.c
4
mouse.c
|
@ -749,8 +749,8 @@ luaA_client_mouse_resize(lua_State *L)
|
|||
client_t **c = luaA_checkudata(L, 1, "client");
|
||||
corner_t corner = AutoCorner;
|
||||
|
||||
if(lua_gettop(L) == 2 && lua_isstring(L, 2))
|
||||
corner = a_strtocorner(lua_tostring(L, 2));
|
||||
if(lua_gettop(L) == 2)
|
||||
corner = a_strtocorner(luaL_checkstring(L, 2));
|
||||
|
||||
mouse_client_resize(*c, corner);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue