Skip to content

Commit b3a8a4f

Browse files
committed
fix: Check whether view has an open entry
1 parent cc01af0 commit b3a8a4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/diffview/lib.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ function M.is_buf_in_use(bufnr)
200200
for _, view in ipairs(M.views) do
201201
if view:instanceof(StandardView.__get()) then
202202
---@cast view StandardView
203-
for _, file in ipairs(view.cur_entry.layout:files()) do
203+
for _, file in ipairs(view.cur_entry and view.cur_entry.layout:files() or {}) do
204204
if file:is_valid() and file.bufnr == bufnr then
205205
return true
206206
end

0 commit comments

Comments
 (0)