From 64ea6cd46f4ee2c9472e88798e69ff77635308f9 Mon Sep 17 00:00:00 2001 From: mads kjeldgaard Date: Wed, 21 Jul 2021 23:31:55 +0200 Subject: recurse_local_nodes: type check local_def to ensure it is a table (#1331) --- lua/nvim-treesitter/locals.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lua') diff --git a/lua/nvim-treesitter/locals.lua b/lua/nvim-treesitter/locals.lua index 741a7631f..0e9211d33 100644 --- a/lua/nvim-treesitter/locals.lua +++ b/lua/nvim-treesitter/locals.lua @@ -127,6 +127,10 @@ end -- @param The full match path to append to -- @param The last match function M.recurse_local_nodes(local_def, accumulator, full_match, last_match) + if type(local_def) ~= "table" then + return + end + if local_def.node then accumulator(local_def, local_def.node, full_match, last_match) else -- cgit v1.2.3-70-g09d2