summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md3
-rw-r--r--script/core/noder.lua5
-rw-r--r--script/core/searcher.lua4
-rw-r--r--script/provider/markdown.lua6
4 files changed, 14 insertions, 4 deletions
diff --git a/changelog.md b/changelog.md
index 70a103bc..0200e159 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,8 @@
# changelog
+## 2.4.0
+* `FIX` runtime errors
+
## 2.3.7
`2021-8-17`
* `CHG` improve performance
diff --git a/script/core/noder.lua b/script/core/noder.lua
index 40a0bb82..a63a1c25 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -313,7 +313,10 @@ local getKeyMap = util.switch()
: call(function (source)
local name = source[1]
if source.typeGeneric then
- return 'dg:' .. source.typeGeneric[name][1].start, nil
+ local first = source.typeGeneric[name][1]
+ if first then
+ return 'dg:' .. first.start, nil
+ end
else
return 'dn:' .. name, nil
end
diff --git a/script/core/searcher.lua b/script/core/searcher.lua
index 38124580..e75293f1 100644
--- a/script/core/searcher.lua
+++ b/script/core/searcher.lua
@@ -335,9 +335,9 @@ local genercCache = {
local function flushGeneric()
--清除来自泛型的临时对象
for _, closure in next, genercCache.closureCache do
- local noders = getNoders(closure)
- removeID(noders, getID(closure))
if closure then
+ local noders = getNoders(closure)
+ removeID(noders, getID(closure))
local values = closure.values
for i = 1, #values do
local value = values[i]
diff --git a/script/provider/markdown.lua b/script/provider/markdown.lua
index a8adbbef..c5765571 100644
--- a/script/provider/markdown.lua
+++ b/script/provider/markdown.lua
@@ -17,7 +17,11 @@ local function checkSplitLine(self)
end
function mt:add(language, text)
- if not text or #text == 0 then
+ if not text then
+ return
+ end
+ text = tostring(text)
+ if #text == 0 then
return
end