Skip to content

Commit f73db12

Browse files
committed
safer git_status_dir
1 parent dbe76bd commit f73db12

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: lua/nvim-tree/git/init.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ function M.git_status_dir(parent_ignored, status, path, path_file)
296296

297297
if status then
298298
return {
299-
file = status.files and status.files[path] or path_file and status.files[path_file],
299+
file = status.files and (status.files[path] or status.files[path_file]),
300300
dir = status.dirs and {
301-
direct = status.dirs.direct[path],
302-
indirect = status.dirs.indirect[path],
301+
direct = status.dirs.direct and status.dirs.direct[path],
302+
indirect = status.dirs.indirect and status.dirs.indirect[path],
303303
},
304304
}
305305
end

0 commit comments

Comments
 (0)