Check if `USERDIR` doesn't exist in `core.delete_temp_files`

This commit is contained in:
Guldoman 2022-04-28 01:54:43 +02:00
parent 3950406750
commit ac42e6457a
No known key found for this signature in database
GPG Key ID: C08A498EC7F1AFDD
1 changed files with 1 additions and 1 deletions

View File

@ -815,7 +815,7 @@ local temp_file_counter = 0
function core.delete_temp_files(dir)
dir = type(dir) == "string" and common.normalize_path(dir) or USERDIR
for _, filename in ipairs(system.list_dir(dir)) do
for _, filename in ipairs(system.list_dir(dir) or {}) do
if filename:find(temp_file_prefix, 1, true) == 1 then
os.remove(dir .. PATHSEP .. filename)
end