about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-06-30 13:58:28 +0200
committerMichael Vetter <jubalh@iodoru.org>2021-06-30 13:58:28 +0200
commitdc79c514be403cff93a1165b47d456182a03fd05 (patch)
treeeeb55b8fe858984c2ec8e5b98619cd7a78ad6b13
parenta46c4443e352d9eada02670125ea5f028559be21 (diff)
downloadprofani-tty-dc79c514be403cff93a1165b47d456182a03fd05.tar.gz
Fix /disco info contact address header
Only display server contact information heading when we have actual
addresses.
-rw-r--r--src/ui/console.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index a99769b1..4cb041a8 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -851,10 +851,12 @@ static void _cons_print_contact_information_hashlist_item(gpointer key, gpointer
 void
 cons_show_disco_contact_information(GHashTable* addresses)
 {
-    cons_show("");
-    cons_show("Server contact information:");
+    if (addresses && g_hash_table_size(addresses) > 0) {
+        cons_show("");
+        cons_show("Server contact information:");
 
-    g_hash_table_foreach(addresses, _cons_print_contact_information_hashlist_item, NULL);
+        g_hash_table_foreach(addresses, _cons_print_contact_information_hashlist_item, NULL);
+    }
 }
 
 void