summaryrefslogtreecommitdiff
path: root/script/workspace/workspace.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/workspace/workspace.lua')
-rw-r--r--script/workspace/workspace.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index 973ae9ec..e69a4be4 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -404,12 +404,15 @@ function m.normalize(path)
return path
end
----@param folderUri uri
+---@param folderUri? uri
---@param path string
----@return string
+---@return string?
function m.getAbsolutePath(folderUri, path)
path = m.normalize(path)
if fs.path(path):is_relative() then
+ if not folderUri then
+ return nil
+ end
local folderPath = furi.decode(folderUri)
path = m.normalize(folderPath .. '/' .. path)
end