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

Fix potential segfault in message_handler::or_else.

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