From 9465aa94af0d07d1f95cab3318c358077eb1e186 Mon Sep 17 00:00:00 2001 From: James Reed Date: Mon, 25 Jan 2021 05:27:45 -0700 Subject: [PATCH] panel: Ensure client is valid after delayed call --- panel.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panel.lua b/panel.lua index 0a7a3e7..ef4e418 100644 --- a/panel.lua +++ b/panel.lua @@ -51,7 +51,8 @@ local function spawn(cmd, args) end c:connect_signal("unfocus", function () gtimer.delayed_call(function () - if c and not (client.focus and client.focus.floating) then + local valid = pcall(function () return c.valid end) and c.valid + if valid and not (client.focus and client.focus.floating) then panel.toggle_func(c, false) end end)