From 6fdee3aa9fb5b59273c72fe4b419237942de70f8 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sat, 12 Jan 2013 19:40:04 +0100 Subject: [PATCH] core: fix crash in display of chat area when the ncurses chat window is not initialized This can happen when a window becomes too small for display: then we set the ncurses chat window to NULL. So when displaying buffer, we'll skip it if the ncurses chat window is NULL. Steps to reproduce crash: 1. /window splith 2. /window resize -1 (many times, until chat area is less than one line) 3. /window balance --- src/gui/curses/gui-curses-chat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c index 5ed4b8cef..ff7c74f05 100644 --- a/src/gui/curses/gui-curses-chat.c +++ b/src/gui/curses/gui-curses-chat.c @@ -1516,7 +1516,8 @@ gui_chat_draw (struct t_gui_buffer *buffer, int clear_chat) for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window) { if ((ptr_win->buffer->number == buffer->number) - && (ptr_win->win_chat_x >= 0) && (ptr_win->win_chat_y >= 0)) + && (ptr_win->win_chat_x >= 0) && (ptr_win->win_chat_y >= 0) + && (GUI_WINDOW_OBJECTS(ptr_win)->win_chat)) { gui_window_coords_alloc (ptr_win);