Return nullopt for state events in rooms we are not in
This commit is contained in:
parent
a6e633cdab
commit
70592911a1
|
@ -451,6 +451,7 @@ private:
|
|||
const std::string &room_id,
|
||||
std::string_view state_key = "")
|
||||
{
|
||||
try {
|
||||
constexpr auto type = mtx::events::state_content_to_type<T>;
|
||||
static_assert(type != mtx::events::EventType::Unsupported,
|
||||
"Not a supported type in state events.");
|
||||
|
@ -484,7 +485,6 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
try {
|
||||
return json::parse(value).get<mtx::events::StateEvent<T>>();
|
||||
} catch (std::exception &e) {
|
||||
return std::nullopt;
|
||||
|
|
Loading…
Reference in New Issue