Skip to content

Commit 8fb036b

Browse files
schnittchenpynappo
authored andcommitted
fix(renderer): bail draw when acquire_window fails
1 parent a1edc4b commit 8fb036b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lua/neo-tree/ui/renderer.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,13 @@ draw = function(nodes, state, parent_id)
14031403
return
14041404
end
14051405
else
1406-
M.acquire_window(state)
1406+
local winid = M.acquire_window(state)
1407+
if not winid or not state.bufnr then
1408+
-- acquire_window bailed out (e.g. the target window was closed before the
1409+
-- async scan finished). Don't try to build a tree without a buffer.
1410+
log.trace("Could not acquire window, aborting draw")
1411+
return
1412+
end
14071413
create_tree(state)
14081414
end
14091415
---@cast state neotree.StateWithTree

0 commit comments

Comments
 (0)