diff options
| author | mads kjeldgaard <mail@madskjeldgaard.dk> | 2021-07-21 23:31:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-21 16:31:55 -0500 |
| commit | d4c645c4d9d06c646188d39ee93868fa8c8d2a13 (patch) | |
| tree | fd7cfd4722c99896760cb753784fa13be13f7970 | |
| parent | e473630fe0872cb0ed97cd7085e724aa58bc1c84 (diff) | |
recurse_local_nodes: type check local_def to ensure it is a table (#1331)
| -rw-r--r-- | lua/nvim-treesitter/locals.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/locals.lua b/lua/nvim-treesitter/locals.lua index 741a7631..0e9211d3 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 |
