Commit 284740c
authored
fix: avoid error when it exceeds timeout (#539)
When I ran this code, I got an error below.
```lua
async.util.block_on(function()
async.util.sleep(4000)
end)
print "done"
```
```bash
E5113: Error while calling lua chunk: /tmp/hoge.lua:4: bad argument #1 to 'block_on' (table expected, got nil)
stack traceback:
[C]: in function 'block_on'
/tmp/hoge.lua:4: in main chunk
```
This means the func is terminated by `vim.wait` and the variable `ret`
is still `nil`. So `unpack(ret)` raises an error.
This PR fixes this bug by setting a default value for `ret`.1 parent 5001291 commit 284740c
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
0 commit comments