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
This commit is contained in:
Sebastien Helleu 2013-01-12 19:40:04 +01:00
parent 4123263b8c
commit 6fdee3aa9f

View File

@ -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);