mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
"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
This commit is contained in:
parent
df2ad566d8
commit
09e20e1d78
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user