Bug 1409667 - If an error occur it can happen the Http2Session does not have a connection. r=mcmanus
authorDragana Damjanovic <dd.mozilla@gmail.com>
Wed, 18 Oct 2017 16:27:32 +0200
changeset 386991 facba2d0369909bf717c88c2c8f10ba19e880f7f
parent 386990 bde8a772d00825426357bb2e7716c083a6f178b4
child 386992 0181d804e8bf9babc3e91f4fcd7d2cf6491372ab
push id32705
push userryanvm@gmail.com
push dateThu, 19 Oct 2017 01:01:49 +0000
treeherdermozilla-central@a21099ce055f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs1409667
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1409667 - If an error occur it can happen the Http2Session does not have a connection. r=mcmanus
netwerk/protocol/http/Http2Session.cpp
--- a/netwerk/protocol/http/Http2Session.cpp
+++ b/netwerk/protocol/http/Http2Session.cpp
@@ -2672,18 +2672,21 @@ Http2Session::OnTransportStatus(nsITrans
   case NS_NET_STATUS_CONNECTED_TO:
   case NS_NET_STATUS_TLS_HANDSHAKE_STARTING:
   case NS_NET_STATUS_TLS_HANDSHAKE_ENDED:
   {
 
     if (!mFirstHttpTransaction) {
       // if we still do not have a HttpTransaction store timings info in
       // a HttpConnection.
-      RefPtr<nsHttpConnection> conn = mConnection->HttpConnection();
-      conn->SetEvent(aStatus);
+      // If some error occur it can happen that we do not have a connection.
+      if (mConnection) {
+        RefPtr<nsHttpConnection> conn = mConnection->HttpConnection();
+        conn->SetEvent(aStatus);
+      }
     } else {
       mFirstHttpTransaction->OnTransportStatus(aTransport, aStatus, aProgress);
     }
 
     if (aStatus == NS_NET_STATUS_TLS_HANDSHAKE_ENDED) {
       mFirstHttpTransaction = nullptr;
       mTlsHandshakeFinished = true;
     }