summaryrefslogtreecommitdiff
path: root/script/core/command/autoRequire.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/core/command/autoRequire.lua')
-rw-r--r--script/core/command/autoRequire.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/script/core/command/autoRequire.lua b/script/core/command/autoRequire.lua
index a96cc918..9f3ff929 100644
--- a/script/core/command/autoRequire.lua
+++ b/script/core/command/autoRequire.lua
@@ -132,6 +132,7 @@ end
---@async
return function (data)
+ ---@type uri
local uri = data.uri
local target = data.target
local name = data.name
@@ -158,5 +159,7 @@ return function (data)
end
local offset, fmt = findInsertRow(uri)
- applyAutoRequire(uri, offset, name, requireName, fmt)
+ if offset and fmt then
+ applyAutoRequire(uri, offset, name, requireName, fmt)
+ end
end