Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix trying to perform arithmetic on nil hunk_offset
I got this locally. I'm not sure how I got there, but there I was: ``` ...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: ....local/share/nvim/lazy/neogit/lua/neogit/lib/ui/init.lua:507: attempt to perform arithmetic on field 'hunk _offset' (a nil value) stack traceback: ^I[C]: in function 'error' ^I...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next' ^I...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'step' ^I...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:48: in function 'execute' ^I...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:118: in function 'callback' ^I...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:25: in function 'callback_or_next' ^I...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'saved_callback' ^I...are/nvim/lazy/plenary.nvim/lua/plenary/async/control.lua:126: in function 'tx' ^I.../share/nvim/lazy/plenary.nvim/lua/plenary/async/util.lua:71: in function 'callback' ^I...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:25: in function 'callback_or_next' ^I...share/nvim/lazy/plenary.nvim/lua/plenary/async/async.lua:45: in function 'cb' ^I...sto/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:334: in function <...sto/.local/share/nvim/lazy/neogit/lua/neogit/process.lua:292> ``` See `attempt to perform arithmetic on field 'hunk _offset' (a nil value)`. This PR works around that by defaulting to `0` if there is no `hunk_offset`.
- Loading branch information