Fix crash in project search when project has no files

This commit is contained in:
Guldoman 2021-08-29 04:02:53 +02:00 committed by Francesco Abbate
parent d3bd35b577
commit e93bbc559c
1 changed files with 1 additions and 1 deletions

View File

@ -171,7 +171,7 @@ function ResultsView:draw()
local ox, oy = self:get_content_offset() local ox, oy = self:get_content_offset()
local x, y = ox + style.padding.x, oy + style.padding.y local x, y = ox + style.padding.x, oy + style.padding.y
local files_number = core.project_files_number() local files_number = core.project_files_number()
local per = files_number and self.last_file_idx / files_number or 1 local per = common.clamp(files_number and self.last_file_idx / files_number or 1, 0, 1)
local text local text
if self.searching then if self.searching then
if files_number then if files_number then