Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 2cfc102

Browse files
authored
Add two checks for nullptr. (#12)
1 parent 6730160 commit 2cfc102

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

quic_transport/impl/quic_transport_owt_client_impl.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ QuicTransportStreamInterface* QuicTransportOwtClientImpl::CreateOutgoingStream(
190190
QuicTransportStreamInterface*
191191
QuicTransportOwtClientImpl::CreateOutgoingStreamOnCurrentThread(
192192
bool bidirectional) {
193+
if (!client_->session()) {
194+
return nullptr;
195+
}
193196
::quic::QuicTransportStream* stream =
194197
bidirectional ? client_->session()->OpenOutgoingBidirectionalStream()
195198
: client_->session()->OpenOutgoingUnidirectionalStream();
@@ -217,6 +220,7 @@ void QuicTransportOwtClientImpl::OnIncomingStreamAvailable(bool bidirectional) {
217220
CHECK(stream);
218221
if (visitor_) {
219222
auto* owt_stream = OwtStreamForNativeStream(stream);
223+
CHECK(owt_stream);
220224
visitor_->OnIncomingStream(owt_stream);
221225
} else {
222226
// No one cares about incoming streams.

0 commit comments

Comments
 (0)