summaryrefslogtreecommitdiff
path: root/src/core/expandos.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/expandos.c')
-rw-r--r--src/core/expandos.c9
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 "";
}