Skip to content

Commit

Permalink
fix: nil check for repo cache
Browse files Browse the repository at this point in the history
  • Loading branch information
lewis6991 committed Jul 9, 2024
1 parent 2593efa commit 375c44b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/gitsigns/git/repo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,12 @@ end

function M:unref()
local gitdir = self.gitdir
local refcount = repo_cache[gitdir][1]
local repo = repo_cache[gitdir]
if not repo then
-- Already reclaimed by GC
return
end
local refcount = repo[1]
if refcount <= 1 then
repo_cache[gitdir] = nil
else
Expand Down

0 comments on commit 375c44b

Please sign in to comment.