From b5fd7f7ae0ea4537511077ed8ef4a6021cedba2f Mon Sep 17 00:00:00 2001 From: xudyang1 <61672396+xudyang1@users.noreply.github.com> Date: Wed, 18 Sep 2024 22:26:50 -0400 Subject: [PATCH] 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 or This is a temp fix for that. --- lua/telescope/pickers.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/telescope/pickers.lua b/lua/telescope/pickers.lua index abc517c..33a24bd 100644 --- a/lua/telescope/pickers.lua +++ b/lua/telescope/pickers.lua @@ -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