From 7630cf4a92b69cc22347894c81cc03966b2a7bcf Mon Sep 17 00:00:00 2001 From: Azad <49314270+Akmadan23@users.noreply.github.com> Date: Mon, 30 Oct 2023 02:46:21 +0100 Subject: [PATCH] fix(#2495): skip API action if node == nil (#2499) * fix(#2495): skip action if node == nil * simplify --------- Co-authored-by: Alexander Courtis --- lua/nvim-tree/api.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/nvim-tree/api.lua b/lua/nvim-tree/api.lua index 6c672626..3bac11c3 100644 --- a/lua/nvim-tree/api.lua +++ b/lua/nvim-tree/api.lua @@ -45,7 +45,9 @@ end local function wrap_node(f) return function(node, ...) node = node or require("nvim-tree.lib").get_node_at_cursor() - f(node, ...) + if node then + f(node, ...) + end end end