fix(picker): nil check manager on toggle_selection (#3283)
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.
This commit is contained in:
@@ -957,7 +957,7 @@ end
|
|||||||
--- Also updates the highlighting for the given entry
|
--- Also updates the highlighting for the given entry
|
||||||
---@param row number: the number of the chosen row
|
---@param row number: the number of the chosen row
|
||||||
function Picker:toggle_selection(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
|
if entry == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user