Prevent nil dereference when no focussed client

This commit is contained in:
Emmanuel Lepage Vallée 2014-09-08 17:36:09 +02:00
parent c2170dbc1d
commit 21b412ece2
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ local function start_loop(is_swap,is_max)
end
function module.focus(direction,c,max)
local screen = (c or capi.client.focus).screen
local screen = (c and c.screen) or (capi.client.focus and capi.client.focus.screen) or capi.mouse.screen
-- Useless when there is only 1 client tiled, incompatible with the "max_out" mode (in this case, focus floating mode)
if awful.layout.get(screen) == awful.layout.suit.max and #awful.client.tiled(screen) > 1 and not max then
current_mode = "max"