Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 340d3a9

Browse files
authoredMay 14, 2024
fix: nil access exception with git integration when changing branches (#2774)
Fix nil access exception appearing when changing branches
1 parent edd4e25 commit 340d3a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎lua/nvim-tree/explorer/node.lua‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ end
2929
---@param absolute_path string
3030
---@return GitStatus
3131
local function get_git_status(parent_ignored, status, absolute_path)
32-
local file_status = parent_ignored and "!!" or status.files and status.files[absolute_path]
32+
local file_status = parent_ignored and "!!" or (status and status.files and status.files[absolute_path])
3333
return { file = file_status }
3434
end
3535

0 commit comments

Comments
 (0)
Please sign in to comment.