Skip to content

Commit

Permalink
fix: return early to avoid errors with no asyncfns (#616)
Browse files Browse the repository at this point in the history
When no async functions are supplied, it will be stuck because rx()
waits forever. This diff fixes it.
  • Loading branch information
delphinus authored Aug 19, 2024
1 parent a3e3bc8 commit ec28942
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/plenary/async/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ end
M.join = function(async_fns)
local len = #async_fns
local results = {}
if len == 0 then
return results
end

local done = 0

local tx, rx = channel.oneshot()
Expand Down

0 comments on commit ec28942

Please sign in to comment.