if (tunnelState->noConnections()) {
// ConnStateData pipeline should contain the CONNECT we are performing
- auto ctx = tunnelState->http->getConn()->pipeline.front();
- if (ctx != nullptr)
- ctx->finished();
+ // but it may be invalid already (bug 4392)
+ if (tunnelState->http.valid() && tunnelState->http->getConn()) {
+ auto ctx = tunnelState->http->getConn()->pipeline.front();
+ if (ctx != nullptr)
+ ctx->finished();
+ }
delete tunnelState;
return;
}
if (tunnelState->noConnections()) {
// ConnStateData pipeline should contain the CONNECT we are performing
- auto ctx = tunnelState->http->getConn()->pipeline.front();
- if (ctx != nullptr)
- ctx->finished();
+ // but it may be invalid already (bug 4392)
+ if (tunnelState->http.valid() && tunnelState->http->getConn()) {
+ auto ctx = tunnelState->http->getConn()->pipeline.front();
+ if (ctx != nullptr)
+ ctx->finished();
+ }
delete tunnelState;
return;
}