Skip to content

Commit

Permalink
fix(telescope): avoid error when plugin_data is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
jedrzejboczar committed Nov 13, 2023
1 parent a4180c7 commit 07483f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/possession/display.lua
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ local function buf_display_builder(buf)
end

local function remove_empty_plugin_data(plugin_data)
for plugin, data in pairs(plugin_data) do
for plugin, data in pairs(plugin_data or {}) do
if type(data) == 'table' and utils.tbl_deep_count(data) == 0 then
plugin_data[plugin] = nil
end
Expand Down Expand Up @@ -341,6 +341,7 @@ local function in_buffer_pretty(data, buf, opts)
end
end

data.plugins = data.plugins or {}
if not opts.include_empty_plugin_data then
remove_empty_plugin_data(data.plugins)
end
Expand Down

0 comments on commit 07483f4

Please sign in to comment.