From f558ac1a289da796dde22e56c7df6fa2f60d3208 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 7 Aug 2019 02:44:47 -0700 Subject: [PATCH] ircd::m::room::power: Prevent exception on json::type() for no collection. --- ircd/m_room.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ircd/m_room.cc b/ircd/m_room.cc index 2b191b65f..14a8b7375 100644 --- a/ircd/m_room.cc +++ b/ircd/m_room.cc @@ -4641,7 +4641,8 @@ const prop? json::object{content.get(prop)} : content }; - if(prop && json::type(string_view{collection}) != json::OBJECT) + const string_view _collection{collection}; + if(prop && (!_collection || json::type(_collection) != json::OBJECT)) return; for(auto it(begin(collection)); it != end(collection) && ret; ++it)