Do not print the nickname on SERVER_SIGNOFF if we do not have it.
authorPekka Riikonen <priikone@silcnet.org>
Mon, 16 Dec 2002 18:43:33 +0000 (18:43 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Mon, 16 Dec 2002 18:43:33 +0000 (18:43 +0000)
Fixes asserts in Irssi Core.

apps/irssi/src/silc/core/client_ops.c

index a355cacc399e127e081aee2426ef8fc1df87638c..b55b0d31a7c859a9aa96d21fb73d0cdce191311c 100644 (file)
@@ -932,12 +932,18 @@ void silc_notify(SilcClient client, SilcClientConnection conn,
   
       for (i = 0; i < clients_count; i++) {
        memset(buf, 0, sizeof(buf));
-       if (clients[i]->username)
-         snprintf(buf, sizeof(buf) - 1, "%s@%s",
-                  clients[i]->username, clients[i]->hostname);
-       signal_emit("message quit", 4, server, clients[i]->nickname,
-                   clients[i]->username ? buf : "", 
-                   "server signoff");
+
+       /* Print only if we have the nickname.  If this client has just quit
+          when we were only resolving it, it is possible we don't have the
+          nickname. */
+       if (clients[i]->nickname) {
+         if (clients[i]->username)
+           snprintf(buf, sizeof(buf) - 1, "%s@%s",
+                    clients[i]->username, clients[i]->hostname);
+         signal_emit("message quit", 4, server, clients[i]->nickname,
+                     clients[i]->username ? buf : "", 
+                     "server signoff");
+       }
 
        silc_server_free_ftp(server, clients[i]);