Commit 3d645069 authored by Dominik Charousset's avatar Dominik Charousset

Check doorman ptr before dereferencing it

parent 0ec3160d
......@@ -744,8 +744,9 @@ bool test_multiplexer::try_accept_connection() {
doormen.emplace_back(&kvp.second);
}
// Try accepting a new connection on all existing doorman.
return std::any_of(doormen.begin(), doormen.end(),
[](doorman_data* x) { return x->ptr->new_connection(); });
return std::any_of(doormen.begin(), doormen.end(), [](doorman_data* x) {
return x->ptr != nullptr ? x->ptr->new_connection() : false;
});
}
bool test_multiplexer::try_read_data() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment