diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-04-11 19:12:39 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-04-11 19:12:39 +0800 |
commit | 654cca03f254dbb5c589db771388edea5d56a711 (patch) | |
tree | bb6ef4f3fa9f40e8235e39be7a2f706d25309700 /script/workspace | |
parent | 3b642df7cb6730f35342803089f2d6d495ddd554 (diff) | |
download | lua-language-server-654cca03f254dbb5c589db771388edea5d56a711.zip |
#1037 check nil
Diffstat (limited to 'script/workspace')
-rw-r--r-- | script/workspace/require-path.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/script/workspace/require-path.lua b/script/workspace/require-path.lua index ca4a0e98..aec298a6 100644 --- a/script/workspace/require-path.lua +++ b/script/workspace/require-path.lua @@ -154,14 +154,18 @@ local function removeVisiblePath(uri) return end for _, scp in ipairs(workspace.folders) do - scp:get('visiblePath')[path] = nil + if scp:get('visiblePath') then + scp:get('visiblePath')[path] = nil + end ---@type collector local clt = scp:get('requireName') if clt then clt:dropUri(uri) end end - scope.fallback:get('visiblePath')[path] = nil + if scope.fallback:get('visiblePath') then + scope.fallback:get('visiblePath')[path] = nil + end ---@type collector local clt = scope.fallback:get('requireName') if clt then |