Skip to content

Commit 654cca0

Browse files
committed
#1037 check nil
1 parent 3b642df commit 654cca0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

script/workspace/require-path.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,18 @@ local function removeVisiblePath(uri)
154154
return
155155
end
156156
for _, scp in ipairs(workspace.folders) do
157-
scp:get('visiblePath')[path] = nil
157+
if scp:get('visiblePath') then
158+
scp:get('visiblePath')[path] = nil
159+
end
158160
---@type collector
159161
local clt = scp:get('requireName')
160162
if clt then
161163
clt:dropUri(uri)
162164
end
163165
end
164-
scope.fallback:get('visiblePath')[path] = nil
166+
if scope.fallback:get('visiblePath') then
167+
scope.fallback:get('visiblePath')[path] = nil
168+
end
165169
---@type collector
166170
local clt = scope.fallback:get('requireName')
167171
if clt then

0 commit comments

Comments
 (0)