aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 22c8a2bf05..c15a6f1330 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -447,7 +447,8 @@ void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last)
return;
}
- if (win_valid_any_tab(win)) {
+ if (win != NULL // Avoid bogus clang warning.
+ && win_valid_any_tab(win)) {
// Set b_last_cursor when closing the last window for the buffer.
// Remember the last cursor position and window options of the buffer.
// This used to be only for the current window, but then options like
@@ -575,7 +576,9 @@ void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last)
if (buf == curbuf && !is_curbuf)
return;
- if (win_valid_any_tab(win) && win->w_buffer == buf) {
+ if (win != NULL // Avoid bogus clang warning.
+ && win_valid_any_tab(win)
+ && win->w_buffer == buf) {
win->w_buffer = NULL; // make sure we don't use the buffer now
}