0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-30 17:34:04 +01:00

ircd:Ⓜ️ Assert non-empty event_id for the throwing index(event_id).

This commit is contained in:
Jason Volk 2019-07-11 16:47:17 -07:00
parent 10fcd5ee21
commit 9629028552

View file

@ -1693,18 +1693,14 @@ catch(const json::not_found &)
ircd::m::event::idx ircd::m::event::idx
ircd::m::index(const event &event, ircd::m::index(const event &event,
std::nothrow_t) std::nothrow_t)
try
{ {
return index(event.event_id, std::nothrow); return index(event.event_id, std::nothrow);
} }
catch(const json::not_found &)
{
return 0;
}
ircd::m::event::idx ircd::m::event::idx
ircd::m::index(const event::id &event_id) ircd::m::index(const event::id &event_id)
{ {
assert(event_id);
const auto ret const auto ret
{ {
index(event_id, std::nothrow) index(event_id, std::nothrow)