Return from batch if requests is empty

Fixes a hang if you tried to close a window with the keybind with no windows open
This commit is contained in:
Ottatop 2024-02-24 15:23:42 -06:00
parent e734a716c0
commit 2e5853eabe

View file

@ -58,6 +58,10 @@ local util = {}
---
---@return T[] responses The results of each request in the same order that they were in `requests`.
function util.batch(requests)
if #requests == 0 then
return {}
end
local loop = require("cqueues").new()
local responses = {}