Skip to content

Commit 00e3e24

Browse files
fix: add nil check for diffview performance issue (#199)
1 parent 8859c47 commit 00e3e24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/gitlab/actions/discussions/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ M.modifiable = function(bool)
7474
local view = diffview_lib.get_current_view()
7575
local a = view.cur_layout.a.file.bufnr
7676
local b = view.cur_layout.b.file.bufnr
77-
if vim.api.nvim_buf_is_loaded(a) then
77+
if a ~= nil and vim.api.nvim_buf_is_loaded(a) then
7878
vim.api.nvim_buf_set_option(a, "modifiable", bool)
7979
end
80-
if vim.api.nvim_buf_is_loaded(b) then
80+
if b ~= nil and vim.api.nvim_buf_is_loaded(b) then
8181
vim.api.nvim_buf_set_option(b, "modifiable", bool)
8282
end
8383
end

0 commit comments

Comments
 (0)