mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd:Ⓜ️:room::power: Prevent exception on json::type() for no collection.
This commit is contained in:
parent
6f6f6c6451
commit
f558ac1a28
1 changed files with 2 additions and 1 deletions
|
@ -4641,7 +4641,8 @@ const
|
||||||
prop? json::object{content.get(prop)} : content
|
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;
|
return;
|
||||||
|
|
||||||
for(auto it(begin(collection)); it != end(collection) && ret; ++it)
|
for(auto it(begin(collection)); it != end(collection) && ret; ++it)
|
||||||
|
|
Loading…
Reference in a new issue