diff options
Diffstat (limited to 'script/workspace/workspace.lua')
-rw-r--r-- | script/workspace/workspace.lua | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index c76eec55..10e4b2c9 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -37,11 +37,15 @@ end local function interfaceFactory(root) return { type = function (path) - if fs.is_directory(fs.path(root .. '/' .. path)) then - return 'directory' - else - return 'file' - end + local result + pcall(function () + if fs.is_directory(fs.path(root .. '/' .. path)) then + result = 'directory' + else + result = 'file' + end + end) + return result end, list = function (path) local fullPath = fs.path(root .. '/' .. path) |