From 901ebed8ffc804caf7f82a328eb7f2f7c74a242b Mon Sep 17 00:00:00 2001 From: Stefan Rusu Date: Thu, 14 Jul 2011 12:52:43 +0300 Subject: [PATCH] Fixes #1304. The Connection instance may be destroyed by abort() when process.nextTick is executed. --- lib/tls.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/tls.js b/lib/tls.js index 291c31c..f5bb333 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -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(); }); } -- 2.7.4