fix(finder): followup to #2442, make sure entry is not nil (#2526)

This commit is contained in:
Simon Hauser
2023-05-24 14:13:50 +02:00
committed by GitHub
parent 3f1b57908b
commit 19e8a8ae8b
3 changed files with 12 additions and 4 deletions

View File

@@ -75,7 +75,9 @@ function JobFinder:_find(prompt, process_result, process_complete)
local entry
if self.entry_maker then
entry = self.entry_maker(line)
entry.index = line_num
if entry then
entry.index = line_num
end
else
entry = line
end
@@ -141,7 +143,9 @@ function DynamicFinder:_find(prompt, process_result, process_complete)
for _, result in ipairs(results) do
result_num = result_num + 1
local entry = self.entry_maker(result)
entry.index = result_num
if entry then
entry.index = result_num
end
if process_result(entry) then
return
end