diff options
author | Timo Sirainen <cras@irssi.org> | 2000-06-15 18:33:08 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-06-15 18:33:08 +0000 |
commit | 09e20e1d78c91ce7ba72720ef13a24e1b8bb1bfe (patch) | |
tree | 8969796b2c17368bd1a36bd169175a5af41caac8 | |
parent | df2ad566d8717e9a7f4e8f0bd3d92f539696546e (diff) | |
download | irssi-09e20e1d78c91ce7ba72720ef13a24e1b8bb1bfe.zip |
"window changed" signal handler didn't check if the old or new window
is NULL.
window_has_query()
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@351 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r-- | src/fe-common/irc/fe-query.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/fe-common/irc/fe-query.c b/src/fe-common/irc/fe-query.c index 4413be38..d93ae114 100644 --- a/src/fe-common/irc/fe-query.c +++ b/src/fe-common/irc/fe-query.c @@ -131,6 +131,8 @@ static int window_has_query(WINDOW_REC *window) { GSList *tmp; + g_return_val_if_fail(window != NULL, FALSE); + for (tmp = window->items; tmp != NULL; tmp = tmp->next) { if (irc_item_query(tmp->data)) return TRUE; @@ -147,9 +149,9 @@ static void sig_window_changed(WINDOW_REC *window, WINDOW_REC *old_window) /* reset the window's last_line timestamp so that query doesn't get closed immediately after switched to the window, or after changed to some other window from it */ - if (window_has_query(window)) + if (window != NULL && window_has_query(window)) window->last_line = time(NULL); - if (window_has_query(old_window)) + if (old_window != NULL && window_has_query(old_window)) old_window->last_line = time(NULL); } |