Fix a bug of Null ptr
This commit is contained in:
parent
5ea972e5b3
commit
ee2517c52b
|
@ -251,7 +251,7 @@ void HttpServer::onRequest(const TcpConnectionPtr &conn, const HttpRequestImplPt
|
|||
{
|
||||
conn->getLoop()->queueInLoop([conn, req, newResp, this]() {
|
||||
HttpServerContext *context = any_cast<HttpServerContext>(conn->getMutableContext());
|
||||
if (context->getFirstRequest() == req)
|
||||
if (context && context->getFirstRequest() == req)
|
||||
{
|
||||
context->popFirstRequest();
|
||||
sendResponse(conn, newResp);
|
||||
|
|
Loading…
Reference in New Issue