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
parent 76334a7946
commit ab6eac399c
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 x, y = ox + style.padding.x, oy + style.padding.y
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
if self.searching then
if files_number then