From 1b852d18425b632d0fe7db3059cea910b8102803 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Fri, 11 Jun 2021 13:25:53 +0200 Subject: [PATCH] util.findFiles: Don't die on broken symlinks (#7829) --- frontend/util.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/util.lua b/frontend/util.lua index c93084425..f6d54c8ee 100644 --- a/frontend/util.lua +++ b/frontend/util.lua @@ -699,7 +699,8 @@ function util.findFiles(dir, cb) if not ok then return end for f in iter, dir_obj do local path = current.."/"..f - local attr = lfs.attributes(path) + -- lfs can return nil here, as it will follow symlinks! + local attr = lfs.attributes(path) or {} if attr.mode == "directory" then if f ~= "." and f ~= ".." then scan(path)