0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-01 00:08:22 +02:00

ircd:Ⓜ️ Fix return value for index(event_id).

This commit is contained in:
Jason Volk 2018-09-27 17:10:54 -07:00
parent 4b142de177
commit cedfff720a

View file

@ -1412,12 +1412,20 @@ ircd::m::index(const event &event,
ircd::m::event::idx ircd::m::event::idx
ircd::m::index(const event::id &event_id) ircd::m::index(const event::id &event_id)
{ {
if(!index(event_id, std::nothrow)) const auto ret
{
index(event_id, std::nothrow)
};
if(!ret)
throw m::NOT_FOUND throw m::NOT_FOUND
{ {
"no index found for %s", "no index found for %s",
string_view{event_id} string_view{event_id}
}; };
return ret;
} }
ircd::m::event::idx ircd::m::event::idx