From 9629028552c28327963f1c7d03d920a73dec85b3 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 11 Jul 2019 16:47:17 -0700 Subject: [PATCH] ircd::m: Assert non-empty event_id for the throwing index(event_id). --- ircd/m_event.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ircd/m_event.cc b/ircd/m_event.cc index 14a6e0ab6..d864aa3aa 100644 --- a/ircd/m_event.cc +++ b/ircd/m_event.cc @@ -1693,18 +1693,14 @@ catch(const json::not_found &) ircd::m::event::idx ircd::m::index(const event &event, std::nothrow_t) -try { return index(event.event_id, std::nothrow); } -catch(const json::not_found &) -{ - return 0; -} ircd::m::event::idx ircd::m::index(const event::id &event_id) { + assert(event_id); const auto ret { index(event_id, std::nothrow)