From 2d386f12767bdf158d56675692c96f7f6f19870d Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Sun, 23 May 2021 12:11:56 +1000 Subject: [PATCH] fix listing empty dirs --- src/lua/core/filesystem.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lua/core/filesystem.lua b/src/lua/core/filesystem.lua index 8b5ef74..2214488 100644 --- a/src/lua/core/filesystem.lua +++ b/src/lua/core/filesystem.lua @@ -123,7 +123,7 @@ function filesystem.register(basePath, uuid) end function fs.list(path) checkArg(1, path, "string") - return native.fs_list(realpath(path)) --TODO: Test, check if dirs get / at end + return native.fs_list(realpath(path)) or {} --TODO: Test, check if dirs get / at end end function fs.lastModified(path) checkArg(1, path, "string") @@ -159,4 +159,4 @@ function filesystem.register(basePath, uuid) return modules.component.api.register(uuid, "filesystem", fs) end -return filesystem \ No newline at end of file +return filesystem