From 9841792194e5d778da8f8b28ca049d2c3d15fca9 Mon Sep 17 00:00:00 2001 From: Matt Weller Date: Mon, 13 Nov 2023 21:49:01 -0800 Subject: [PATCH 1/2] fix for nil status error messages --- lua/nvim-tree/explorer/node.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lua/nvim-tree/explorer/node.lua b/lua/nvim-tree/explorer/node.lua index 3d0119be655..e17a90de647 100644 --- a/lua/nvim-tree/explorer/node.lua +++ b/lua/nvim-tree/explorer/node.lua @@ -14,13 +14,15 @@ local function get_dir_git_status(parent_ignored, status, absolute_path) return { file = "!!" } end - return { - file = status.files and status.files[absolute_path], - dir = status.dirs and { - direct = status.dirs.direct[absolute_path], - indirect = status.dirs.indirect[absolute_path], - }, - } + if type(status) ~= nil and status ~= nil then + return { + file = status.files and status.files[absolute_path], + dir = status.dirs and { + direct = status.dirs.direct[absolute_path], + indirect = status.dirs.indirect[absolute_path], + }, + } + end end local function get_git_status(parent_ignored, status, absolute_path) From 827950dba0c2a9b6bd71aee7105ee707df68189a Mon Sep 17 00:00:00 2001 From: Matt Weller Date: Tue, 14 Nov 2023 07:01:37 -0800 Subject: [PATCH 2/2] simplify logic --- 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 e17a90de647..3a84e6e740c 100644 --- a/lua/nvim-tree/explorer/node.lua +++ b/lua/nvim-tree/explorer/node.lua @@ -14,7 +14,7 @@ local function get_dir_git_status(parent_ignored, status, absolute_path) return { file = "!!" } end - if type(status) ~= nil and status ~= nil then + if status then return { file = status.files and status.files[absolute_path], dir = status.dirs and {