From 0e2fbb115a48facea9b5798b60f40ac28513275a Mon Sep 17 00:00:00 2001 From: Jacob Kania Date: Mon, 13 May 2024 18:13:29 +0200 Subject: [PATCH] Fix nil access exception appearing when changing branches --- lua/nvim-tree/explorer/node.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/nvim-tree/explorer/node.lua b/lua/nvim-tree/explorer/node.lua index 6e58771e73b..5657826f10c 100644 --- a/lua/nvim-tree/explorer/node.lua +++ b/lua/nvim-tree/explorer/node.lua @@ -29,7 +29,7 @@ end ---@param absolute_path string ---@return GitStatus local function get_git_status(parent_ignored, status, absolute_path) - local file_status = parent_ignored and "!!" or status.files and status.files[absolute_path] + local file_status = parent_ignored and "!!" or (status and status.files and status.files[absolute_path]) return { file = file_status } end