fix: add nil check

This commit is contained in:
Lewis Russell 2022-12-15 14:07:35 +00:00
parent 0ca581e4f0
commit 3a13f536f0
2 changed files with 6 additions and 2 deletions

View File

@ -256,7 +256,9 @@ local function get_hunks(bufnr, bcache, greedy, staged)
else
text = bcache.compare_text
end
hunks = run_diff(text, buftext, false)
if text then
hunks = run_diff(text, buftext, false)
end
scheduler()
else
if staged then

View File

@ -256,7 +256,9 @@ local function get_hunks(bufnr: integer, bcache: CacheEntry, greedy: boolean, st
else
text = bcache.compare_text
end
hunks = run_diff(text, buftext, false)
if text then
hunks = run_diff(text, buftext, false)
end
scheduler()
else
if staged then