diff options
author | Timo Sirainen <cras@irssi.org> | 2002-03-23 17:42:48 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-03-23 17:42:48 +0000 |
commit | 187208764216b2a41a98fd3c839dfe9f6a214368 (patch) | |
tree | 52e92b4dcf599dbd7b8b25bc7e37c3303d6f2103 /src/core | |
parent | 8d2a14b47600eae8043eb18d6eb125fa0e463813 (diff) | |
download | irssi-187208764216b2a41a98fd3c839dfe9f6a214368.zip |
$topic shouldn't crash if query doesn't have a valid address set yet.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2639 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/expandos.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/expandos.c b/src/core/expandos.c index c5711f91..130d6025 100644 --- a/src/core/expandos.c +++ b/src/core/expandos.c @@ -436,9 +436,14 @@ static char *expando_topic(SERVER_REC *server, void *item, int *free_ret) if (IS_QUERY(item)) { QUERY_REC *query = QUERY(item); + if (query->server_tag == NULL) + return ""; + *free_ret = TRUE; - return g_strdup_printf("%s (%s)", query->address, - query->server_tag); + return query->address == NULL ? + g_strdup_printf("(%s)", query->server_tag) : + g_strdup_printf("%s (%s)", query->address, + query->server_tag); } return ""; } |