Skip to content

Commit e4588e9

Browse files
committed
fix runtime errors
1 parent d59f982 commit e4588e9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

script/core/noder.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,11 @@ local function getFieldEventName(field)
186186
if not secondTypeUnit or secondTypeUnit.type ~= 'doc.type.function' then
187187
return nil
188188
end
189-
local eventName = firstEnum[1]:match [[^['"](.+)['"]$]]
189+
local enmuStr = firstEnum[1]
190+
if type(enmuStr) ~= 'string' then
191+
return nil
192+
end
193+
local eventName = enmuStr:match [[^['"](.+)['"]$]]
190194
field._eventName = eventName
191195
return eventName
192196
end

script/workspace/require-path.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ end
148148
local function removeVisiblePath(uri)
149149
local path = furi.decode(uri)
150150
path = workspace.normalize(path)
151+
if not path then
152+
return
153+
end
151154
for _, scp in ipairs(workspace.folders) do
152155
scp:get('visiblePath')[path] = nil
153156
---@type collector

0 commit comments

Comments
 (0)