Skip to content

Commit c883df9

Browse files
committed
chore: resolve undefined-field
1 parent 5290897 commit c883df9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ function M.fn(default_modifier)
125125
return
126126
end
127127

128-
if node:is(DirectoryNode) then
129-
node = node:last_group_node()
128+
local dir = node:as(DirectoryNode)
129+
if dir then
130+
node = dir:last_group_node()
130131
end
131132
if node.name == ".." then
132133
return

0 commit comments

Comments
 (0)