1
0
mirror of https://github.com/irssi/irssi.git synced 2024-08-11 03:44:15 -04:00

Autolog shouldn't crash when lines are written without destination window

(can happen at /upgrade)


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2950 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-10-14 15:33:55 +00:00 committed by cras
parent 55c2e7a066
commit 77b3ab3c44

View File

@ -475,12 +475,13 @@ static void log_single_line(WINDOW_REC *window, const char *server_tag,
char **targets, **tmp;
LOG_REC *log;
/* save to log created with /WINDOW LOG */
ltoa(windownum, window->refnum);
log = logs_find_item(LOG_ITEM_WINDOW_REFNUM,
windownum, NULL, NULL);
if (log != NULL) {
log_write_rec(log, text, level);
if (window != NULL) {
/* save to log created with /WINDOW LOG */
ltoa(windownum, window->refnum);
log = logs_find_item(LOG_ITEM_WINDOW_REFNUM,
windownum, NULL, NULL);
if (log != NULL)
log_write_rec(log, text, level);
}
if (target == NULL)