diff --git a/lua/gitsigns/actions.lua b/lua/gitsigns/actions.lua index 198c4afd0..7f5c33b7b 100644 --- a/lua/gitsigns/actions.lua +++ b/lua/gitsigns/actions.lua @@ -228,6 +228,9 @@ end --- @return Gitsigns.Hunk.Hunk? local function get_hunk(bufnr, range, greedy, staged) local bcache = cache[bufnr] + if not bcache then + return + end local hunks = get_hunks(bufnr, bcache, greedy, staged) if not range then