Skip to content

Commit

Permalink
fix: passing nil as window handle in view.get_winnr
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkov63 committed Jan 19, 2024
1 parent f24afa2 commit 48a90ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/nvim-tree/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ end
function M.get_winnr(tabpage)
tabpage = tabpage or vim.api.nvim_get_current_tabpage()
local tabinfo = M.View.tabpages[tabpage]
if tabinfo ~= nil and vim.api.nvim_win_is_valid(tabinfo.winnr) then
if tabinfo and tabinfo.winnr and vim.api.nvim_win_is_valid(tabinfo.winnr) then
return tabinfo.winnr
end
end
Expand Down

0 comments on commit 48a90ee

Please sign in to comment.