Skip to content

Commit 841d05d

Browse files
committed
refactor(#2731): handle directory unavailable when deleting
1 parent aa58dbd commit 841d05d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/nvim-tree/actions/fs/remove-file.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ end
4949
---@param cwd string
5050
---@return boolean|nil
5151
local function remove_dir(cwd)
52-
local handle = vim.loop.fs_scandir(cwd)
53-
if type(handle) == "string" then
54-
notify.error(handle)
52+
local handle, err = vim.loop.fs_scandir(cwd)
53+
if not handle then
54+
notify.error(err)
5555
return
5656
end
5757

0 commit comments

Comments
 (0)