summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2013-07-17 18:35:01 +0200
committerSebastien Helleu <flashcode@flashtux.org>2013-07-17 18:35:01 +0200
commitc10cfb6aa0e57a33aece3ce81ba8a40d1fd03024 (patch)
tree2cfabe9d0e7ee7c6ad3233e9ad6984c99fbe86cc
parentbee56c3b7fa6ef0ce820a8f0a7e5e51b95aa3fab (diff)
downloadweechat-c10cfb6aa0e57a33aece3ce81ba8a40d1fd03024.zip
core: do nothing in "/window scroll_beyond_end" if the buffer has no lines
-rw-r--r--src/gui/curses/gui-curses-window.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index fc5b8e9b3..21ec67da6 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -1498,9 +1498,12 @@ gui_window_scroll_beyond_end (struct t_gui_window *window)
if (!gui_init_ok)
return;
- window->scroll->start_line = window->buffer->lines->last_line;
- window->scroll->start_line_pos = -1;
- gui_buffer_ask_chat_refresh (window->buffer, 2);
+ if (window->buffer->lines)
+ {
+ window->scroll->start_line = window->buffer->lines->last_line;
+ window->scroll->start_line_pos = -1;
+ gui_buffer_ask_chat_refresh (window->buffer, 2);
+ }
}
/*