summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/highlight.lua2
-rw-r--r--script/core/searcher.lua3
2 files changed, 4 insertions, 1 deletions
diff --git a/script/core/highlight.lua b/script/core/highlight.lua
index d1f11906..759029c3 100644
--- a/script/core/highlight.lua
+++ b/script/core/highlight.lua
@@ -229,7 +229,7 @@ local function isLiteralValue(source)
if not guide.isLiteral(source) then
return false
end
- if source.parent.index == source then
+ if source.parent and source.parent.index == source then
return false
end
return true
diff --git a/script/core/searcher.lua b/script/core/searcher.lua
index 3055a5f4..79b605b5 100644
--- a/script/core/searcher.lua
+++ b/script/core/searcher.lua
@@ -657,6 +657,9 @@ local function prepareSearch(source)
or source.type == 'method' then
source = source.parent
end
+ if not source then
+ return
+ end
local root = guide.getRoot(source)
noder.compileNodes(root)
local uri = guide.getUri(source)