libt2n: (gerd) add safety-check to send_hello
authorGerd v. Egidy <gerd.von.egidy@intra2net.com>
Fri, 21 Nov 2008 10:35:25 +0000 (10:35 +0000)
committerGerd v. Egidy <gerd.von.egidy@intra2net.com>
Fri, 21 Nov 2008 10:35:25 +0000 (10:35 +0000)
src/command_server.cpp

index 2e3beb5..e41d41b 100644 (file)
@@ -54,7 +54,9 @@ command_server::command_server(server& _s)
 void command_server::send_hello(unsigned int conn_id)
 {
     server_connection* sc=s.get_connection(conn_id);
-    // TODO: Gerd: Throw exception if get_connection() returns NULL or just return?
+
+    if (!sc)
+        return;         // connection not existing, so no hello
 
     std::ostringstream hello;