summaryrefslogtreecommitdiff
path: root/src/gui/curses/gui-curses-chat.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2013-01-12 19:40:04 +0100
committerSebastien Helleu <flashcode@flashtux.org>2013-01-12 19:40:04 +0100
commit6fdee3aa9fb5b59273c72fe4b419237942de70f8 (patch)
tree4516a4dd5621c03189aaf3338bff377a575c2903 /src/gui/curses/gui-curses-chat.c
parent4123263b8c8015d802fa7b74270bffd3a8bf1d4d (diff)
downloadweechat-6fdee3aa9fb5b59273c72fe4b419237942de70f8.zip
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
Diffstat (limited to 'src/gui/curses/gui-curses-chat.c')
-rw-r--r--src/gui/curses/gui-curses-chat.c3
1 files changed, 2 insertions, 1 deletions
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);