Index: net/quic/quic_connection.cc |
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc |
index 79f0d5d25ecda3306082fc2ba7ce71c50e2f3ea0..3473472c787f1ed6d03fa986c6d3c5168ff79aba 100644 |
--- a/net/quic/quic_connection.cc |
+++ b/net/quic/quic_connection.cc |
@@ -18,6 +18,7 @@ |
#include "base/logging.h" |
#include "base/macros.h" |
#include "base/memory/ref_counted.h" |
+#include "base/metrics/histogram_macros.h" |
#include "base/stl_util.h" |
#include "base/strings/stringprintf.h" |
#include "net/base/net_errors.h" |
@@ -2073,7 +2074,13 @@ void QuicConnection::CloseConnection(QuicErrorCode error, bool from_peer) { |
} |
connected_ = false; |
DCHECK(visitor_ != nullptr); |
- visitor_->OnConnectionClosed(error, from_peer); |
+ // TODO(rtenneti): crbug.com/546668. A temporary fix. Added a check for null |
+ // |visitor_| to fix crash bug. Delete it after fix is merged. |
Alexei Svitkine (slow)
2016/02/01 19:03:14
Planning to delete the histogram at that point too
ramant (doing other things)
2016/02/01 19:12:18
Done.
|
+ if (visitor_) { |
+ visitor_->OnConnectionClosed(error, from_peer); |
+ } else { |
+ UMA_HISTOGRAM_BOOLEAN("Net.QuicCloseConnection.NullVisitor", true); |
+ } |
if (debug_visitor_ != nullptr) { |
debug_visitor_->OnConnectionClosed(error, from_peer); |
} |