diff options
author | sumneko <sumneko@hotmail.com> | 2022-03-11 23:53:59 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2022-03-11 23:53:59 +0800 |
commit | b8ceb409198684c5d4b4162cedfa8b270d62c261 (patch) | |
tree | be2d06073f330cc97596e15bbf80a21dfb9087ff | |
parent | e3cf2df47f2201b6b8a45e1412d882260580494d (diff) | |
download | lua-language-server-b8ceb409198684c5d4b4162cedfa8b270d62c261.zip |
check nil
-rw-r--r-- | script/files.lua | 6 |
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 |