fix(#2495): skip API action if node == nil (#2499)

* fix(#2495): skip action if node == nil

* simplify

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Azad 2023-10-30 02:46:21 +01:00 committed by GitHub
parent df38f1f30d
commit 7630cf4a92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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