Skip to content

Commit 93e11a7

Browse files
Copilotithewei
andcommitted
Add defensive null check for writer when io is null in Reset()
Co-authored-by: ithewei <26049660+ithewei@users.noreply.github.com>
1 parent 4545e19 commit 93e11a7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

http/server/HttpHandler.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ void HttpHandler::Reset() {
127127
if (io) {
128128
writer = std::make_shared<HttpResponseWriter>(io, resp);
129129
writer->status = hv::SocketChannel::CONNECTED;
130+
} else {
131+
writer = NULL;
130132
}
131133
parser->InitRequest(req.get());
132134
// Re-hook http_cb for the new request object

0 commit comments

Comments
 (0)