Skip to content

Commit

Permalink
check nil
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Mar 11, 2022
1 parent e3cf2df commit b8ceb40
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions script/files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b8ceb40

Please # to comment.