Fix a bug of Null ptr

This commit is contained in:
an-tao 2019-01-07 18:50:56 +08:00
parent 5ea972e5b3
commit ee2517c52b
1 changed files with 1 additions and 1 deletions

View File

@ -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);