diff options
author | Timo Sirainen <cras@irssi.org> | 2002-03-14 06:44:06 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-03-14 06:44:06 +0000 |
commit | 7d58cc000f66551a72e0546b65e0ef2fb8167b72 (patch) | |
tree | 9e1999504f24926b81ac2b74ed0fb0ddc72ec933 /src | |
parent | 7647e3ed4c6f79ab194858dad86f0552b0c4bfe0 (diff) | |
download | irssi-7d58cc000f66551a72e0546b65e0ef2fb8167b72.zip |
Don't crash when trying to print text when there's no windows yet. Also
print the text to stdout.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2610 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/fe-windows.c | 3 | ||||
-rw-r--r-- | src/fe-common/core/printtext.c | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/fe-common/core/fe-windows.c b/src/fe-common/core/fe-windows.c index fe76427b..38dd22fe 100644 --- a/src/fe-common/core/fe-windows.c +++ b/src/fe-common/core/fe-windows.c @@ -247,7 +247,8 @@ WINDOW_REC *window_find_level(void *server, int level) GSList *tmp; /* prefer active window if possible */ - if (WINDOW_LEVEL_MATCH(active_win, server, level)) + if (active_win != NULL && + WINDOW_LEVEL_MATCH(active_win, server, level)) return active_win; for (tmp = windows; tmp != NULL; tmp = tmp->next) { diff --git a/src/fe-common/core/printtext.c b/src/fe-common/core/printtext.c index 36984219..dbd52343 100644 --- a/src/fe-common/core/printtext.c +++ b/src/fe-common/core/printtext.c @@ -415,9 +415,15 @@ static void sig_print_text(TEXT_DEST_REC *dest, const char *text) char *str, *tmp; g_return_if_fail(dest != NULL); - g_return_if_fail(dest->window != NULL); g_return_if_fail(text != NULL); + if (dest->window == NULL) { + str = strip_codes(text); + printf("NO WINDOWS: %s\n", str); + g_free(str); + return; + } + msg_beep_check(dest); if ((dest->level & MSGLEVEL_NEVER) == 0) |