mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Return nullopt for state events in rooms we are not in
This commit is contained in:
parent
a6e633cdab
commit
70592911a1
1 changed files with 33 additions and 33 deletions
|
@ -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 a new issue