Fixes #1304. The Connection instance may be destroyed by abort() when process.nextTic...
authorStefan Rusu <saltwaterc@gmail.com>
Thu, 14 Jul 2011 09:52:43 +0000 (12:52 +0300)
committerkoichik <koichik@improvement.jp>
Thu, 14 Jul 2011 15:32:46 +0000 (00:32 +0900)
lib/tls.js

index 291c31c..f5bb333 100644 (file)
@@ -496,7 +496,10 @@ function SecurePair(credentials, isServer, requestCert, rejectUnauthorized) {
   this.encrypted = new EncryptedStream(this);
 
   process.nextTick(function() {
-    self.ssl.start();
+    /* The Connection may be destroyed by an abort call */
+    if (self.ssl) {
+      self.ssl.start();
+    }
     self.cycle();
   });
 }