summaryrefslogtreecommitdiff
path: root/src/fe-common/core/fe-log.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-10-14 15:33:55 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-10-14 15:33:55 +0000
commit77b3ab3c44f4a4baf2d879d889f0aad65cfa2eef (patch)
tree3a7e4a48ec666756a63f7e13893d02d347914253 /src/fe-common/core/fe-log.c
parent55c2e7a066e700e23e15ba9f90d2aa02118b27dd (diff)
downloadirssi-77b3ab3c44f4a4baf2d879d889f0aad65cfa2eef.zip
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
Diffstat (limited to 'src/fe-common/core/fe-log.c')
-rw-r--r--src/fe-common/core/fe-log.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/fe-common/core/fe-log.c b/src/fe-common/core/fe-log.c
index f4b6f4c5..215d4a52 100644
--- a/src/fe-common/core/fe-log.c
+++ b/src/fe-common/core/fe-log.c
@@ -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)