diff options
author | Timo Sirainen <cras@irssi.org> | 2001-11-29 23:50:47 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-11-29 23:50:47 +0000 |
commit | 6e4b26414838991c5daa7391765e3d420e2101f7 (patch) | |
tree | 179c1fbddee94aae885d863b049ec69ed0a4cc70 /src/fe-text | |
parent | 5d52832efd741484d6afa77cfa65cc90a1b2f8c9 (diff) | |
download | irssi-6e4b26414838991c5daa7391765e3d420e2101f7.zip |
Make sure the more-statusbar item doesn't crash if there's no active window.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2170 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text')
-rw-r--r-- | src/fe-text/statusbar-items.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/fe-text/statusbar-items.c b/src/fe-text/statusbar-items.c index 2f9a43fc..aa69769b 100644 --- a/src/fe-text/statusbar-items.c +++ b/src/fe-text/statusbar-items.c @@ -221,10 +221,17 @@ static void item_more(SBAR_ITEM_REC *item, int get_size_only) MAIN_WINDOW_REC *mainwin; int visible; - mainwin = WINDOW_MAIN(active_win); - visible = WINDOW_GUI(active_win)->view->more_text; + if (active_win == NULL) { + mainwin = NULL; + visible = FALSE; + } else { + mainwin = WINDOW_MAIN(active_win); + visible = WINDOW_GUI(active_win)->view->more_text; + } + if (!visible) { - more_visible = g_slist_remove(more_visible, mainwin); + if (mainwin != NULL) + more_visible = g_slist_remove(more_visible, mainwin); if (get_size_only) item->min_size = item->max_size = 0; return; |