From 2f974736ac74bd3cacdb6b2a9b5a47ad18650664 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 25 May 2022 07:14:50 +0800 Subject: fix(coverity): bail out if mouse_find_win() returns NULL (#18726) --- src/nvim/normal.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 7c7a042eac..1ba49ea8f3 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -1854,6 +1854,9 @@ bool do_mouse(oparg_T *oap, int c, int dir, long count, bool fixindent) int click_row = mouse_row; int click_col = mouse_col; win_T *wp = mouse_find_win(&click_grid, &click_row, &click_col); + if (wp == NULL) { + return false; + } StlClickDefinition *click_defs = in_status_line ? wp->w_status_click_defs : wp->w_winbar_click_defs; -- cgit