Prevent warning on empty user requests

This commit is contained in:
Nicolas Werner 2021-04-16 17:09:38 +02:00
parent a402e85a0f
commit 1b0af04cc8
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -2414,6 +2414,9 @@ Cache::joinedRooms()
std::optional<MemberInfo> std::optional<MemberInfo>
Cache::getMember(const std::string &room_id, const std::string &user_id) Cache::getMember(const std::string &room_id, const std::string &user_id)
{ {
if (user_id.empty())
return std::nullopt;
try { try {
auto txn = lmdb::txn::begin(env_, nullptr, MDB_RDONLY); auto txn = lmdb::txn::begin(env_, nullptr, MDB_RDONLY);