diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-29 02:27:13 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-29 02:27:13 +0800 |
commit | 4190a3e8ebd0ff1408fc47927394970de952f18c (patch) | |
tree | 46d4ef193af05ef864a839135e990f6f5f5b2810 /script/workspace/workspace.lua | |
parent | 87288efc77c68be375d6c534109f734f2cc99df9 (diff) | |
download | lua-language-server-4190a3e8ebd0ff1408fc47927394970de952f18c.zip |
fix runtime errors reported by telemetry
Diffstat (limited to 'script/workspace/workspace.lua')
-rw-r--r-- | script/workspace/workspace.lua | 7 |
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 |