Skip to content

Commit

Permalink
fix(picker): nil check manager on toggle_selection (#3283)
Browse files Browse the repository at this point in the history
Probably due to some async race condition, when typing fast, an error "attempt to index field 'manager' (a boolean value)" can be thrown if accidentally pressed <Tab> or <C-i> 

This is a temp fix for that.
  • Loading branch information
xudyang1 authored Sep 19, 2024
1 parent 0df05c9 commit b5fd7f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/telescope/pickers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ end
--- Also updates the highlighting for the given entry
---@param row number: the number of the chosen row
function Picker:toggle_selection(row)
local entry = self.manager:get_entry(self:get_index(row))
local entry = self.manager and self.manager:get_entry(self:get_index(row))
if entry == nil then
return
end
Expand Down

0 comments on commit b5fd7f7

Please sign in to comment.