Skip to content

Commit ec28942

Browse files
authored
fix: return early to avoid errors with no asyncfns (#616)
When no async functions are supplied, it will be stuck because rx() waits forever. This diff fixes it.
1 parent a3e3bc8 commit ec28942

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lua/plenary/async/util.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ end
5353
M.join = function(async_fns)
5454
local len = #async_fns
5555
local results = {}
56+
if len == 0 then
57+
return results
58+
end
59+
5660
local done = 0
5761

5862
local tx, rx = channel.oneshot()

0 commit comments

Comments
 (0)