Skip to content

Commit e55ae43

Browse files
authored
fix(job): shutdown raises error (#296)
`job:shutdown()` raises an error if called without a `_shutdown_check` running. From what I experienced that is basically always the case. This just checks if `_shutdown_check` is nil before passing it to `vim.loop.is_active`
1 parent d742fd9 commit e55ae43

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lua/plenary/job.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ end
214214

215215
--- Shutdown a job.
216216
function Job:shutdown(code, signal)
217-
if not uv.is_active(self._shutdown_check) then
217+
if self._shutdown_check and not uv.is_active(self._shutdown_check) then
218218
vim.wait(1000, function()
219219
return self:_pipes_are_closed(self) and self.is_shutdown
220220
end, 1, true)

0 commit comments

Comments
 (0)