client: return nil if client is not attached to a screen yet
Can happen with the "new" class signal. Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
023a216f67
commit
db10f783a6
2
client.c
2
client.c
|
@ -1922,6 +1922,8 @@ luaA_client_get_type(lua_State *L, client_t *c)
|
||||||
static int
|
static int
|
||||||
luaA_client_get_screen(lua_State *L, client_t *c)
|
luaA_client_get_screen(lua_State *L, client_t *c)
|
||||||
{
|
{
|
||||||
|
if(!c->screen)
|
||||||
|
return 0;
|
||||||
lua_pushnumber(L, 1 + screen_array_indexof(&globalconf.screens, c->screen));
|
lua_pushnumber(L, 1 + screen_array_indexof(&globalconf.screens, c->screen));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue