From 1a50b94066def8591d5f65bd60a4233902e9def4 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Sun, 7 Apr 2024 09:24:19 +0100 Subject: [PATCH] fix: check bcache in get_hunks Fixes #979 Closes #981 --- lua/gitsigns/actions.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/gitsigns/actions.lua b/lua/gitsigns/actions.lua index 198c4af..7f5c33b 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