summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2022-03-11 23:53:59 +0800
committersumneko <sumneko@hotmail.com>2022-03-11 23:53:59 +0800
commitb8ceb409198684c5d4b4162cedfa8b270d62c261 (patch)
treebe2d06073f330cc97596e15bbf80a21dfb9087ff
parente3cf2df47f2201b6b8a45e1412d882260580494d (diff)
downloadlua-language-server-b8ceb409198684c5d4b4162cedfa8b270d62c261.zip
check nil
-rw-r--r--script/files.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/script/files.lua b/script/files.lua
index 7bd96611..bd533c35 100644
--- a/script/files.lua
+++ b/script/files.lua
@@ -80,8 +80,10 @@ function m.close(uri)
file.trusted = false
end
m.onWatch('close', uri)
- if (file._ref or 0) <= 0 and not m.isOpen(uri) then
- m.remove(uri)
+ if file then
+ if (file._ref or 0) <= 0 and not m.isOpen(uri) then
+ m.remove(uri)
+ end
end
end