diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index 0ca7ad78454249..e092458dd94b44 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -747,10 +747,10 @@ void TLSWrap::OnStreamRead(ssize_t nread, const uv_buf_t& buf) { return; } - if (ssl_ == nullptr) { - EmitRead(UV_EPROTO); - return; - } + // DestroySSL() is the only thing that un-sets ssl_, but that also removes + // this TLSWrap as a stream listener, so we should not receive OnStreamRead() + // calls anymore. + CHECK(ssl_); // Commit the amount of data actually read into the peeked/allocated buffer // from the underlying stream.