mirror of
https://github.com/irssi/irssi.git
synced 2026-08-08 19:30:15 +02: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
1 changed files with 4 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue