Skip to content
Snippets Groups Projects
Commit bcf8ab54 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

http: check for null callbacks

parent f7c8168f
No related branches found
No related tags found
No related merge requests found
......@@ -352,7 +352,7 @@ Resolver::add_callback(ResolverCb cb)
{
std::lock_guard<std::mutex> lock(mutex_);
if (!completed_)
cbs_.push(std::move(cb));
cbs_.emplace(std::move(cb));
else
cb(ec_, endpoints_);
}
......@@ -587,7 +587,7 @@ void
Request::notify_state_change(const State state)
{
state_ = state;
if (cbs_->on_state_change)
if (cbs_ and cbs_->on_state_change)
cbs_->on_state_change(state, response_);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment