Index: net/quic/quic_connection.cc |
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc |
index f34ea5d3f593a738d949b4c8d1e0786c5bebd20b..8162c3c964dc98304587d17590f43edef5b75bcc 100644 |
--- a/net/quic/quic_connection.cc |
+++ b/net/quic/quic_connection.cc |
@@ -1944,7 +1944,11 @@ QuicConnection::ScopedPacketBundler::ScopedPacketBundler( |
QuicConnection* connection, |
AckBundling send_ack) |
: connection_(connection), |
- already_in_batch_mode_(connection->packet_generator_.InBatchMode()) { |
+ already_in_batch_mode_(connection != NULL && |
+ connection->packet_generator_.InBatchMode()) { |
+ if (connection_ == NULL) { |
+ return; |
+ } |
// Move generator into batch mode. If caller wants us to include an ack, |
// check the delayed-ack timer to see if there's ack info to be sent. |
if (!already_in_batch_mode_) { |
@@ -1962,6 +1966,9 @@ QuicConnection::ScopedPacketBundler::ScopedPacketBundler( |
} |
QuicConnection::ScopedPacketBundler::~ScopedPacketBundler() { |
+ if (connection_ == NULL) { |
+ return; |
+ } |
// If we changed the generator's batch state, restore original batch state. |
if (!already_in_batch_mode_) { |
DVLOG(1) << "Leaving Batch Mode."; |