diff options
author | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2018-03-26 12:46:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-26 12:46:04 +0200 |
commit | 7fc59d2d1016e28eced6dbcaddc1e1865fe0ebe8 (patch) | |
tree | e8225ec8feeb8429f3b9636e222bd07938b524c4 /src/fe-text/textbuffer-view.c | |
parent | 191e0ac84ed42b51395ff9659b4f6169a1fcb3aa (diff) | |
parent | c7ca8102c002287f492ca71f2193ee9b269f5bf5 (diff) | |
download | irssi-7fc59d2d1016e28eced6dbcaddc1e1865fe0ebe8.zip |
Merge pull request #862 from ailin-nemui/line_is_null
fix a crash when trying to append to a NULL line
Diffstat (limited to 'src/fe-text/textbuffer-view.c')
-rw-r--r-- | src/fe-text/textbuffer-view.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c index 99625ecc..3ccd95f5 100644 --- a/src/fe-text/textbuffer-view.c +++ b/src/fe-text/textbuffer-view.c @@ -913,11 +913,14 @@ void textbuffer_view_resize(TEXT_BUFFER_VIEW_REC *view, int width, int height) } else if (view->startline == view->bottom_startline && view->subline > view->bottom_subline) { view->subline = view->bottom_subline; - } else { + } else if (view->startline != NULL) { /* make sure the subline is still in allowed range */ linecount = view_get_linecount(view, view->startline); if (view->subline > linecount) view->subline = linecount; + } else { + /* we don't have a startline. still under construction? */ + view->subline = 0; } textbuffer_view_init_ypos(view); |