Skip to content

Commit 0fc5032

Browse files
committed
fix(nvim-tree#2395): adds check if node_at_cursor.parent is nil
1 parent f9fb648 commit 0fc5032

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/nvim-tree/marks/bulk-move.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ function M.bulk_move()
1818
local node_at_cursor = lib.get_node_at_cursor()
1919
local default_path = core.get_cwd()
2020

21-
if node_at_cursor and node_at_cursor.type ~= "directory" then
22-
default_path = node_at_cursor.parent.absolute_path
23-
elseif node_at_cursor then
21+
if node_at_cursor and node_at_cursor.type == "directory" then
2422
default_path = node_at_cursor.absolute_path
23+
elseif node_at_cursor and node_at_cursor.parent then
24+
default_path = node_at_cursor.parent.absolute_path
2525
end
2626

2727
local input_opts = {

0 commit comments

Comments
 (0)