Commit 0c0fc1c8 authored by Matthias Vallentin's avatar Matthias Vallentin

Fix potential segfault in message_handler::or_else.

parent 750d9492
......@@ -111,7 +111,13 @@ class message_handler {
// using a behavior is safe here, because we "cast"
// it back to a message_handler when appropriate
behavior tmp{std::forward<Ts>(args)...};
return m_impl->or_else(tmp.as_behavior_impl());
if (! tmp) {
return *this;
}
if (m_impl) {
return m_impl->or_else(tmp.as_behavior_impl());
}
return tmp;
}
private:
......
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